Fixes incorrect optimization of try/catch statements

This commit is contained in:
konsoletyper 2014-02-26 22:02:09 +04:00
parent 1f18148144
commit 43acca8706

View File

@ -551,8 +551,12 @@ class OptimizingVisitor implements StatementVisitor, ExprVisitor {
@Override @Override
public void visit(TryCatchStatement statement) { public void visit(TryCatchStatement statement) {
processSequence(statement.getProtectedBody()); List<Statement> statements = processSequence(statement.getProtectedBody());
processSequence(statement.getHandler()); statement.getProtectedBody().clear();
statement.getProtectedBody().addAll(statements);
statements = processSequence(statement.getHandler());
statement.getHandler().clear();
statement.getHandler().addAll(statements);
resultStmt = statement; resultStmt = statement;
} }
} }