mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
fix wrong block return type calculation with synchronized
This commit is contained in:
parent
f5e8e48356
commit
5013f2f819
@ -133,6 +133,8 @@ class WasmBlockInstruction extends WasmInstruction {
|
||||
case DROP:
|
||||
case THROW:
|
||||
case RETHROW:
|
||||
case MONITOR_ENTER:
|
||||
case MONITOR_EXIT:
|
||||
return 1;
|
||||
case BLOCK:
|
||||
return data instanceof BlockType ? ((BlockType)data).getParams().size() : 0;
|
||||
|
@ -53,6 +53,7 @@ public class Exceptions extends AbstractBaseTest {
|
||||
addParam( list, script, "complex" );
|
||||
addParam( list, script, "sync" );
|
||||
addParam( list, script, "syncWithInnerTryCatch" );
|
||||
addParam( list, script, "syncInsideCondition" );
|
||||
addParam( list, script, "emptyCatch" );
|
||||
addParam( list, script, "multiCatch" );
|
||||
addParam( list, script, "multiCatch2" );
|
||||
@ -193,6 +194,18 @@ public class Exceptions extends AbstractBaseTest {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Export
|
||||
static int syncInsideCondition() {
|
||||
int value = 0;
|
||||
Object obj = new Object();
|
||||
if( value == 0 ) {
|
||||
synchronized( obj ) {
|
||||
value = 42;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Export
|
||||
static int emptyCatch() {
|
||||
int h = 127; // variable slot 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user