Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd4fa10

Browse files
committed
C++: Tie macro exclusion to <, not +
This fixes a failing qltest and makes the exclusion similar to what's in `PointerOverflow.ql`. It's possible we should exclude based on both `+` and `<`, but we can revisit that if false positives show up.
1 parent f98cd67 commit bd4fa10

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ where
2323
ro.getAnOperand() = expr2 and
2424
globalValueNumber(expr1) = globalValueNumber(expr2) and
2525
add.getUnspecifiedType().(IntegralType).isSigned() and
26-
not isFromMacroDefinition(add) and
26+
not isFromMacroDefinition(ro) and
2727
exprMightOverflowPositively(add) and
2828
exists(Compilation c | c.getAFileCompiled() = ro.getFile() |
2929
not c.getAnArgument() = "-fwrapv" and

0 commit comments

Comments
 (0)