mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
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:
parent
7cfbdc8fdb
commit
73e60adeab
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user