Skip unreachable code in SSA translation

This commit is contained in:
SirYwell 2025-05-07 14:24:55 +02:00
parent cd036e26b7
commit 800e3117c9
No known key found for this signature in database

View file

@ -130,6 +130,10 @@ public class SsaTranslation {
pushSpan(blockTree); pushSpan(blockTree);
for (StatementTree statement : blockTree.statements()) { for (StatementTree statement : blockTree.statements()) {
statement.accept(this, data); statement.accept(this, data);
// skip everything after a return in a block
if (statement instanceof ReturnTree) {
break;
}
} }
popSpan(); popSpan();
return NOT_AN_EXPRESSION; return NOT_AN_EXPRESSION;