Does not unbox if exception handling is not supported.

This commit is contained in:
Volker Berlin 2020-04-26 18:37:10 +02:00
parent f04369fac5
commit fd27656b65

View File

@ -1044,6 +1044,11 @@ class BranchManger {
private void addUnboxExnref( BranchNode catchNode ) {
// unboxing the exnref on the stack to a reference of the exception
int catchPos = catchNode.startPos;
if( !options.useEH() ) {
BranchNode unBoxing = new BranchNode( catchPos, catchPos, WasmBlockOperator.UNREACHABLE, null );
catchNode.add( 0, unBoxing );
return;
}
BranchNode unBoxing = new BranchNode( catchPos, catchPos, WasmBlockOperator.BLOCK, WasmBlockOperator.END, options.getCatchType() );
catchNode.add( 0, unBoxing );