C++: Remove the type restriction on 'GuardConditionFromNotExpr' since this class also applies to C++.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-01-16 16:55:10 +00:00
parent 54faba21ba
commit d0bd6eb2eb
3 changed files with 6 additions and 1 deletions

View File

@@ -268,7 +268,6 @@ private class GuardConditionFromNotExpr extends GuardConditionImpl {
exists(NotExpr notExpr, Type t |
this = notExpr.getOperand() and
t = this.getUnspecifiedType() and
not t instanceof BoolType and
ir.getUnconvertedResultExpression() = notExpr
)
}

View File

@@ -262,9 +262,13 @@
| 122 | b == 0 when b is false |
| 122 | b == 1 when b is true |
| 125 | ! ... != 0 when ! ... is true |
| 125 | ! ... != 0 when call to safe is false |
| 125 | ! ... != 1 when ! ... is false |
| 125 | ! ... != 1 when call to safe is true |
| 125 | ! ... == 0 when ! ... is false |
| 125 | ! ... == 0 when call to safe is true |
| 125 | ! ... == 1 when ! ... is true |
| 125 | ! ... == 1 when call to safe is false |
| 125 | call to safe != 0 when ! ... is false |
| 125 | call to safe != 0 when call to safe is true |
| 125 | call to safe != 1 when ! ... is true |

View File

@@ -540,6 +540,8 @@ unary
| test.cpp:125:13:125:20 | ! ... | test.cpp:125:13:125:20 | ! ... | == | 1 | 125 | 125 |
| test.cpp:125:13:125:20 | ! ... | test.cpp:125:14:125:17 | call to safe | != | 1 | 125 | 125 |
| test.cpp:125:13:125:20 | ! ... | test.cpp:125:14:125:17 | call to safe | == | 0 | 125 | 125 |
| test.cpp:125:14:125:17 | call to safe | test.cpp:125:13:125:20 | ! ... | != | 0 | 125 | 125 |
| test.cpp:125:14:125:17 | call to safe | test.cpp:125:13:125:20 | ! ... | == | 1 | 125 | 125 |
| test.cpp:125:14:125:17 | call to safe | test.cpp:125:14:125:17 | call to safe | != | 1 | 125 | 125 |
| test.cpp:125:14:125:17 | call to safe | test.cpp:125:14:125:17 | call to safe | == | 0 | 125 | 125 |
| test.cpp:131:6:131:21 | call to __builtin_expect | test.cpp:131:6:131:21 | call to __builtin_expect | != | 0 | 131 | 132 |