Skip to content

Commit e77dab7

Browse files
Get a more useful error when we get an unexpected AbstractTruffleException
1 parent 8d8abf0 commit e77dab7

File tree

1 file changed

+4
-1
lines changed
  • espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/nodes

1 file changed

+4
-1
lines changed

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/nodes/BytecodeNode.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,10 @@ private Object executeBodyFromBCI(VirtualFrame frame, int startBCI, int startTop
15921592
// this branch is not compiled, it can be a loop exit
15931593
throw e;
15941594
}
1595-
assert context.getEspressoEnv().Polyglot;
1595+
if (!context.getEspressoEnv().Polyglot) {
1596+
CompilerDirectives.transferToInterpreter();
1597+
throw EspressoError.shouldNotReachHere("Unexpected non-espresso AbstractTruffleException", e);
1598+
}
15961599
Meta meta = getMethod().getMeta();
15971600
meta.polyglot.ForeignException.safeInitialize(); // should fold
15981601
wrappedException = EspressoException.wrap(

0 commit comments

Comments
 (0)