Skip to content

Commit 8b2cfa9

Browse files
authored
Merge pull request #18561 from jketema/jketema/scanf
C++: Fix join-order problem found on `IncorrectCheckScanf.ql`
2 parents dcdc12f + 68ec4b6 commit 8b2cfa9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll

+2-1
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,8 @@ private module Cached {
981981
or
982982
exists(CompareValueNumber cmp, Operand left, Operand right, AbstractValue v |
983983
test = cmp and
984-
cmp.hasOperands(left, right) and
984+
pragma[only_bind_into](cmp)
985+
.hasOperands(pragma[only_bind_into](left), pragma[only_bind_into](right)) and
985986
isConvertedBool(left.getDef()) and
986987
int_value(right.getDef()) = 0 and
987988
unary_compares_eq(valueNumberOfOperand(left), op, k, areEqual, v)

0 commit comments

Comments
 (0)