mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 15:37:52 +01:00
subtract switch start value to compatible with br_table
This commit is contained in:
parent
0ece5f2dfe
commit
b06b368574
@ -753,7 +753,12 @@ public abstract class ModuleWriter implements Closeable {
|
|||||||
byteCode.readInt();
|
byteCode.readInt();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int count = -byteCode.readInt() + byteCode.readInt() + 1;
|
int low = byteCode.readInt();
|
||||||
|
if( low != 0 ) { // the br_table starts ever with the value 0. That we need to subtract the start value if it different
|
||||||
|
writeConstInt( low );
|
||||||
|
writeNumericOperator( NumericOperator.sub, ValueType.i32 );
|
||||||
|
}
|
||||||
|
int count = byteCode.readInt() - low + 1;
|
||||||
for( int i = 0; i < count; i++ ) {
|
for( int i = 0; i < count; i++ ) {
|
||||||
byteCode.readInt();
|
byteCode.readInt();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user