Fix getTempI32() that it work without the removed prepare phase.

This commit is contained in:
Volker 2018-08-11 20:36:09 +02:00
parent fcaa15d22d
commit 758557f76b
2 changed files with 5 additions and 9 deletions

View File

@ -83,13 +83,6 @@ class LocaleVariableManager {
var.valueType = valueType;
}
/**
* We need an extra temporary variable inn the WebAssembly code.
*/
void useTempI32() {
needTempI32 = true;
}
/**
* Calculate the WebAssembly index position on the consumed data.
*/
@ -131,7 +124,8 @@ class LocaleVariableManager {
* @return the slot
*/
int getTempI32() {
return size - 1;
needTempI32 = true;
return -1;
}
/**
@ -142,6 +136,9 @@ class LocaleVariableManager {
* @return the variable index in WebAssembly
*/
int get( int slot ) {
if( slot < 0 ) {
slot = size - 1; // temp i32
}
return variables[slot].idx;
}

View File

@ -751,7 +751,6 @@ public class ModuleGenerator {
int[] keys;
int[] positions;
if( isLookupSwitch ) { // lookupswitch
localVariables.useTempI32(); //TODO
int count = byteCode.readInt();
keys = new int[count];
positions = new int[count];