mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +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();
|
||||
}
|
||||
} 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++ ) {
|
||||
byteCode.readInt();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user