mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C++: Fix handling of unreached instructions in IRGuards
This commit is contained in:
@@ -223,6 +223,9 @@ private class GuardConditionFromIR extends GuardCondition {
|
||||
or
|
||||
instr = tce.getInstruction(ConditionValueFalseTempAddressTag())
|
||||
)
|
||||
or
|
||||
// Exclude unreached instructions, as their AST is the whole function and not a block.
|
||||
instr instanceof UnreachedInstruction
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +257,6 @@ astGuardsControl
|
||||
| test.c:175:13:175:32 | ... == ... | false | 175 | 175 |
|
||||
| test.c:175:13:175:32 | ... == ... | true | 175 | 175 |
|
||||
| test.c:181:9:181:9 | x | false | 183 | 184 |
|
||||
| test.c:181:9:181:9 | x | false | 186 | 180 |
|
||||
| test.c:181:9:181:9 | x | true | 181 | 182 |
|
||||
| test.c:181:9:181:9 | x | true | 186 | 180 |
|
||||
| test.cpp:18:8:18:10 | call to get | true | 19 | 19 |
|
||||
|
||||
Reference in New Issue
Block a user