Skip to content

Commit 6a14748

Browse files
committed
CPP: Add recommended test.
1 parent 27fe996 commit 6a14748

File tree

1 file changed

+6
-0
lines changed
  • cpp/ql/test/query-tests/Likely Bugs/Arithmetic/BadAdditionOverflowCheck

1 file changed

+6
-0
lines changed

cpp/ql/test/query-tests/Likely Bugs/Arithmetic/BadAdditionOverflowCheck/test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,9 @@ void useMarkRange(int offs) {
144144
markRange(buffer, offs, offs + 10);
145145
markRange(buffer, offs, offs); // GOOD (comparison is in the macro)
146146
}
147+
148+
#define MY_MACRO(x) (x)
149+
150+
void myMacroTest(int x) {
151+
MY_MACRO(x == x); // BAD [NOT DETECTED]
152+
}

0 commit comments

Comments
 (0)