Skip to content

Commit 283d6ef

Browse files
committed
Rangeanalysis/Java/C++: Address some ql4ql findings.
1 parent 2592c94 commit 283d6ef

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/analysis/SignAnalysisCommon.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,13 @@ module SignAnalysis<DeltaSig D, UtilSig<Sem, D> Utils> {
511511

512512
/**
513513
* Holds if `e` may have positive values. This does not rule out the
514-
* possibilty for negative values.
514+
* possibility for negative values.
515515
*/
516516
predicate semMayBePositive(SemExpr e) { semExprSign(e) = TPos() }
517517

518518
/**
519519
* Holds if `e` may have negative values. This does not rule out the
520-
* possibilty for positive values.
520+
* possibility for positive values.
521521
*/
522522
predicate semMayBeNegative(SemExpr e) { semExprSign(e) = TNeg() }
523523
}

java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ module Sem implements Semantic {
8181
private import java as J
8282
private import SSA as SSA
8383
private import RangeUtils as RU
84-
private import semmle.code.java.dataflow.internal.rangeanalysis.SsaReadPositionCommon as SSAReadPos
84+
private import semmle.code.java.dataflow.internal.rangeanalysis.SsaReadPositionCommon as SsaReadPos
8585
private import semmle.code.java.controlflow.internal.GuardsLogic as GL
8686

8787
class Expr = J::Expr;
@@ -230,18 +230,18 @@ module Sem implements Semantic {
230230

231231
class SsaExplicitUpdate extends SsaVariable instanceof SSA::SsaExplicitUpdate { }
232232

233-
final private class FinalSsaReadPosition = SSAReadPos::SsaReadPosition;
233+
final private class FinalSsaReadPosition = SsaReadPos::SsaReadPosition;
234234

235235
class SsaReadPosition extends FinalSsaReadPosition {
236236
predicate hasReadOfVar(SsaVariable v) { super.hasReadOfVar(v) }
237237
}
238238

239-
class SsaReadPositionPhiInputEdge extends SsaReadPosition instanceof SSAReadPos::SsaReadPositionPhiInputEdge
239+
class SsaReadPositionPhiInputEdge extends SsaReadPosition instanceof SsaReadPos::SsaReadPositionPhiInputEdge
240240
{
241241
predicate phiInput(SsaPhiNode phi, SsaVariable inp) { super.phiInput(phi, inp) }
242242
}
243243

244-
class SsaReadPositionBlock extends SsaReadPosition instanceof SSAReadPos::SsaReadPositionBlock {
244+
class SsaReadPositionBlock extends SsaReadPosition instanceof SsaReadPos::SsaReadPositionBlock {
245245
BasicBlock getBlock() { result = super.getBlock() }
246246
}
247247

@@ -374,7 +374,7 @@ module JavaLangImpl implements LangSig<Sem, IntDelta> {
374374

375375
module Utils implements UtilSig<Sem, IntDelta> {
376376
private import RangeUtils as RU
377-
private import semmle.code.java.dataflow.internal.rangeanalysis.SsaReadPositionCommon as SSAReadPos
377+
private import semmle.code.java.dataflow.internal.rangeanalysis.SsaReadPositionCommon as SsaReadPos
378378

379379
Sem::Expr semSsaRead(Sem::SsaVariable v, int delta) { result = RU::ssaRead(v, delta) }
380380

@@ -399,10 +399,10 @@ module Utils implements UtilSig<Sem, IntDelta> {
399399
predicate rankedPhiInput(
400400
Sem::SsaPhiNode phi, Sem::SsaVariable inp, Sem::SsaReadPositionPhiInputEdge edge, int r
401401
) {
402-
SSAReadPos::rankedPhiInput(phi, inp, edge, r)
402+
SsaReadPos::rankedPhiInput(phi, inp, edge, r)
403403
}
404404

405-
predicate maxPhiInputRank(Sem::SsaPhiNode phi, int rix) { SSAReadPos::maxPhiInputRank(phi, rix) }
405+
predicate maxPhiInputRank(Sem::SsaPhiNode phi, int rix) { SsaReadPos::maxPhiInputRank(phi, rix) }
406406
}
407407

408408
module Bounds implements BoundSig<Location, Sem, IntDelta> {

shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ signature module SignAnalysisSig<Semantic Sem> {
202202

203203
/**
204204
* Holds if `e` may have positive values. This does not rule out the
205-
* possibilty for negative values.
205+
* possibility for negative values.
206206
*/
207207
predicate semMayBePositive(Sem::Expr e);
208208

209209
/**
210210
* Holds if `e` may have negative values. This does not rule out the
211-
* possibilty for positive values.
211+
* possibility for positive values.
212212
*/
213213
predicate semMayBeNegative(Sem::Expr e);
214214
}

0 commit comments

Comments
 (0)