Skip to content

Commit a56376a

Browse files
committed
C++: rename effectivelyConstant to likelySmall
This reflects the existing QLDoc better and makes it more clear why it includes char-typed expressions.
1 parent 4d2e4c5 commit a56376a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ import semmle.code.cpp.controlflow.SSA
2727
* In these cases the value of `e` is likely to be small and
2828
* controlled, so we consider it less likely to cause an overflow.
2929
*/
30-
predicate effectivelyConstant(Expr e) {
30+
predicate likelySmall(Expr e) {
3131
e.isConstant() or
3232
e.getType().getSize() <= 1 or
3333
e.(ArrayExpr).getArrayBase().getType().(ArrayType).getBaseType().isConst() or
3434
exists(SsaDefinition def, Variable v |
3535
def.getAUse(v) = e and
36-
effectivelyConstant(def.getDefiningValue(v))
36+
likelySmall(def.getDefiningValue(v))
3737
)
3838
}
3939

@@ -58,7 +58,7 @@ int getEffectiveMulOperands(MulExpr me) {
5858
result = count(Expr op |
5959
op = getMulOperand*(me) and
6060
not op instanceof MulExpr and
61-
not effectivelyConstant(op)
61+
not likelySmall(op)
6262
)
6363
}
6464

0 commit comments

Comments
 (0)