fix splitTokens

This commit is contained in:
Volker Berlin 2018-11-16 20:13:53 +01:00
parent 99f7786cf8
commit 88b819628f

View File

@ -70,6 +70,9 @@ public class WatParser extends WasmCodeBuilder {
case "i32.add": case "i32.add":
addNumericInstruction( NumericOperator.add, ValueType.i32, javaCodePos ); addNumericInstruction( NumericOperator.add, ValueType.i32, javaCodePos );
break; break;
case "f32.max":
addNumericInstruction( NumericOperator.max, ValueType.f32, javaCodePos );
break;
case "i64.extend_s/i32": case "i64.extend_s/i32":
addConvertInstruction( ValueTypeConvertion.i2l, javaCodePos ); addConvertInstruction( ValueTypeConvertion.i2l, javaCodePos );
break; break;
@ -138,7 +141,7 @@ public class WatParser extends WasmCodeBuilder {
case '\n': case '\n':
case '\r': case '\r':
case '\t': case '\t':
if( off + 1 < i ) { if( off < i ) {
tokens.add( wat.substring( off, i ) ); tokens.add( wat.substring( off, i ) );
} }
off = i + 1; off = i + 1;