File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
lib/semmle/code/cpp/controlflow
test/library-tests/controlflow/guards Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,6 @@ private class GuardConditionFromNotExpr extends GuardConditionImpl {
268268 exists ( NotExpr notExpr , Type t |
269269 this = notExpr .getOperand ( ) and
270270 t = this .getUnspecifiedType ( ) and
271- not t instanceof BoolType and
272271 ir .getUnconvertedResultExpression ( ) = notExpr
273272 )
274273 }
Original file line number Diff line number Diff line change 262262| 122 | b == 0 when b is false |
263263| 122 | b == 1 when b is true |
264264| 125 | ! ... != 0 when ! ... is true |
265+ | 125 | ! ... != 0 when call to safe is false |
265266| 125 | ! ... != 1 when ! ... is false |
267+ | 125 | ! ... != 1 when call to safe is true |
266268| 125 | ! ... == 0 when ! ... is false |
269+ | 125 | ! ... == 0 when call to safe is true |
267270| 125 | ! ... == 1 when ! ... is true |
271+ | 125 | ! ... == 1 when call to safe is false |
268272| 125 | call to safe != 0 when ! ... is false |
269273| 125 | call to safe != 0 when call to safe is true |
270274| 125 | call to safe != 1 when ! ... is true |
Original file line number Diff line number Diff line change @@ -540,6 +540,8 @@ unary
540540| test.cpp:125:13:125:20 | ! ... | test.cpp:125:13:125:20 | ! ... | == | 1 | 125 | 125 |
541541| test.cpp:125:13:125:20 | ! ... | test.cpp:125:14:125:17 | call to safe | != | 1 | 125 | 125 |
542542| test.cpp:125:13:125:20 | ! ... | test.cpp:125:14:125:17 | call to safe | == | 0 | 125 | 125 |
543+ | test.cpp:125:14:125:17 | call to safe | test.cpp:125:13:125:20 | ! ... | != | 0 | 125 | 125 |
544+ | test.cpp:125:14:125:17 | call to safe | test.cpp:125:13:125:20 | ! ... | == | 1 | 125 | 125 |
543545| test.cpp:125:14:125:17 | call to safe | test.cpp:125:14:125:17 | call to safe | != | 1 | 125 | 125 |
544546| test.cpp:125:14:125:17 | call to safe | test.cpp:125:14:125:17 | call to safe | == | 0 | 125 | 125 |
545547| test.cpp:131:6:131:21 | call to __builtin_expect | test.cpp:131:6:131:21 | call to __builtin_expect | != | 0 | 131 | 132 |
You can’t perform that action at this time.
0 commit comments