always add a trap instruction after a throw

Tail call and dead code optimizations can cause code after a throw to
be eliminated, which confuses findUnwindTarget because it doesn't know
what code is throwing the exception.  So we need at least one
instruction to follow the call to the throw_ thunk.  Previously, we
only added such an instruction when we knew the throw was the last
instruction in the bytecode, but it turns out there are other cases
where it is needed, including certain try/finally situations.
This commit is contained in:
Joel Dice 2014-03-14 09:54:05 -06:00
parent 7cfbdc8fdb
commit 73e60adeab

View File

@ -4333,9 +4333,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
Compiler::VoidType,
2, c->register_(t->arch->thread()), target);
if (ip == codeLength(t, code)) {
c->nullaryOp(lir::Trap);
}
c->nullaryOp(lir::Trap);
} goto next;
case bipush: