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 {
268
268
exists ( NotExpr notExpr , Type t |
269
269
this = notExpr .getOperand ( ) and
270
270
t = this .getUnspecifiedType ( ) and
271
- not t instanceof BoolType and
272
271
ir .getUnconvertedResultExpression ( ) = notExpr
273
272
)
274
273
}
Original file line number Diff line number Diff line change 262
262
| 122 | b == 0 when b is false |
263
263
| 122 | b == 1 when b is true |
264
264
| 125 | ! ... != 0 when ! ... is true |
265
+ | 125 | ! ... != 0 when call to safe is false |
265
266
| 125 | ! ... != 1 when ! ... is false |
267
+ | 125 | ! ... != 1 when call to safe is true |
266
268
| 125 | ! ... == 0 when ! ... is false |
269
+ | 125 | ! ... == 0 when call to safe is true |
267
270
| 125 | ! ... == 1 when ! ... is true |
271
+ | 125 | ! ... == 1 when call to safe is false |
268
272
| 125 | call to safe != 0 when ! ... is false |
269
273
| 125 | call to safe != 0 when call to safe is true |
270
274
| 125 | call to safe != 1 when ! ... is true |
Original file line number Diff line number Diff line change @@ -540,6 +540,8 @@ unary
540
540
| test.cpp:125:13:125:20 | ! ... | test.cpp:125:13:125:20 | ! ... | == | 1 | 125 | 125 |
541
541
| test.cpp:125:13:125:20 | ! ... | test.cpp:125:14:125:17 | call to safe | != | 1 | 125 | 125 |
542
542
| 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 |
543
545
| test.cpp:125:14:125:17 | call to safe | test.cpp:125:14:125:17 | call to safe | != | 1 | 125 | 125 |
544
546
| test.cpp:125:14:125:17 | call to safe | test.cpp:125:14:125:17 | call to safe | == | 0 | 125 | 125 |
545
547
| 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