C++: Fix handling of unreached instructions in IRGuards

This commit is contained in:
Jeroen Ketema
2023-12-06 09:59:42 +01:00
parent d6e30cd828
commit 4390e4cad3
2 changed files with 3 additions and 1 deletions

View File

@@ -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
}
}

View File

@@ -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 |