File tree Expand file tree Collapse file tree
lib/semmle/code/cpp/controlflow
test/library-tests/controlflow/guards-ir Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -223,6 +223,9 @@ private class GuardConditionFromIR extends GuardCondition {
223223 or
224224 instr = tce .getInstruction ( ConditionValueFalseTempAddressTag ( ) )
225225 )
226+ or
227+ // Exclude unreached instructions, as their AST is the whole function and not a block.
228+ instr instanceof UnreachedInstruction
226229 }
227230}
228231
Original file line number Diff line number Diff line change @@ -257,7 +257,6 @@ astGuardsControl
257257| test.c:175:13:175:32 | ... == ... | false | 175 | 175 |
258258| test.c:175:13:175:32 | ... == ... | true | 175 | 175 |
259259| test.c:181:9:181:9 | x | false | 183 | 184 |
260- | test.c:181:9:181:9 | x | false | 186 | 180 |
261260| test.c:181:9:181:9 | x | true | 181 | 182 |
262261| test.c:181:9:181:9 | x | true | 186 | 180 |
263262| test.cpp:18:8:18:10 | call to get | true | 19 | 19 |
You can’t perform that action at this time.
0 commit comments