mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Write also for BR_ON_EXN an UNREACHABLE instruction
This commit is contained in:
parent
c19a9ca9b6
commit
bab77094c2
@ -1320,9 +1320,13 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
|
||||
codeStream.writeOpCode( RETHROW );
|
||||
break;
|
||||
case BR_ON_EXN:
|
||||
codeStream.writeOpCode( BR_ON_EXN );
|
||||
codeStream.writeVaruint32( (Integer)data ); // break depth
|
||||
codeStream.writeVaruint32( 0 ); // event/exception ever 0 because currently there is only one with signature anyref
|
||||
if( options.useEH() ) {
|
||||
codeStream.writeOpCode( BR_ON_EXN );
|
||||
codeStream.writeVaruint32( (Integer)data ); // break depth
|
||||
codeStream.writeVaruint32( 0 ); // event/exception ever 0 because currently there is only one with signature anyref
|
||||
} else {
|
||||
codeStream.writeOpCode( UNREACHABLE );
|
||||
}
|
||||
break;
|
||||
case MONITOR_ENTER:
|
||||
case MONITOR_EXIT:
|
||||
|
@ -783,7 +783,7 @@ public class TextModuleWriter extends ModuleWriter {
|
||||
name = "rethrow";
|
||||
break;
|
||||
case BR_ON_EXN:
|
||||
name = "br_on_exn " + data + " 0"; // br_on_exn, break depth, event; // currently there is only one event/exception with anyref
|
||||
name = options.useEH() ? "br_on_exn " + data + " 0" : "unreachable"; // br_on_exn, break depth, event; // currently there is only one event/exception with anyref
|
||||
break;
|
||||
case MONITOR_ENTER:
|
||||
case MONITOR_EXIT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user