Fix bug in fillZero function

This commit is contained in:
Alexey Andreev 2016-08-25 19:29:48 +03:00
parent 375506e875
commit c5c453d95b
2 changed files with 4 additions and 6 deletions

View File

@ -203,14 +203,14 @@ public final class WasmRuntime {
address.putInt(0);
break;
case 1:
address.add(1).putByte((byte) 0);
address.add(2).putShort((short) 0);
address.add(3).putByte((byte) 0);
break;
case 2:
address.add(2).putShort((short) 0);
break;
case 3:
address.add(3).putByte((byte) 0);
address.add(1).putByte((byte) 0);
address.add(2).putShort((short) 0);
break;
}
@ -232,7 +232,7 @@ public final class WasmRuntime {
break;
}
for (address = Address.fromInt(alignedStart); address.toInt() < alignedEnd; address = address.add(4)) {
for (address = Address.fromInt(alignedStart + 1); address.toInt() < alignedEnd; address = address.add(4)) {
address.putInt(0);
}
}

View File

@ -129,7 +129,6 @@ class WasmGenerationVisitor implements StatementVisitor, ExprVisitor {
private Map<IdentifiedStatement, WasmBlock> continueTargets = new HashMap<>();
private Set<WasmBlock> usedBlocks = new HashSet<>();
private List<Deque<WasmLocal>> temporaryVariablesByType = new ArrayList<>();
private List<WasmLocal> currentTemporaries = new ArrayList<>();
WasmExpression result;
WasmGenerationVisitor(WasmGenerationContext context, WasmClassGenerator classGenerator,
@ -1275,7 +1274,6 @@ class WasmGenerationVisitor implements StatementVisitor, ExprVisitor {
variable = new WasmLocal(type);
function.add(variable);
}
currentTemporaries.add(variable);
return variable;
}