Minor fixes

This commit is contained in:
Alexey Andreev 2016-09-05 00:09:03 +03:00
parent 4d6c91aff8
commit eaf31c1309
2 changed files with 1 additions and 3 deletions

View File

@ -69,7 +69,6 @@ class WasmBinaryRenderingVisitor implements WasmExpressionVisitor {
@Override @Override
public void visit(WasmBlock expression) { public void visit(WasmBlock expression) {
depth += expression.isLoop() ? 2 : 1; depth += expression.isLoop() ? 2 : 1;
//depth++;
blockDepths.put(expression, depth); blockDepths.put(expression, depth);
writer.writeByte(expression.isLoop() ? 0x02 : 0x01); writer.writeByte(expression.isLoop() ? 0x02 : 0x01);
for (WasmExpression part : expression.getBody()) { for (WasmExpression part : expression.getBody()) {
@ -78,7 +77,6 @@ class WasmBinaryRenderingVisitor implements WasmExpressionVisitor {
writer.writeByte(0x0F); writer.writeByte(0x0F);
blockDepths.remove(expression); blockDepths.remove(expression);
depth -= expression.isLoop() ? 2 : 1; depth -= expression.isLoop() ? 2 : 1;
//depth--;
} }
@Override @Override

View File

@ -122,7 +122,7 @@ public class WasmBinaryWriter {
} }
public void writeSignedLEB(long v) { public void writeSignedLEB(long v) {
alloc(5); alloc(10);
while (true) { while (true) {
int digit = (int) (v & 0x7F); int digit = (int) (v & 0x7F);
v >>= 7; v >>= 7;