add support for ref.is_null to wat parser

This commit is contained in:
Volker Berlin 2019-11-09 18:59:47 +01:00
parent 5e2b65ddd0
commit 6d7c8b12a9
2 changed files with 8 additions and 0 deletions

View File

@ -175,6 +175,9 @@ public class WatParser extends WasmCodeBuilder {
case "f64.trunc":
addNumericInstruction( NumericOperator.trunc, ValueType.f64, javaCodePos, lineNumber );
break;
case "ref.is_null":
addNumericInstruction( NumericOperator.ifnull, ValueType.i32, javaCodePos, lineNumber );
break;
case "table.get":
addTableInstruction( true, getInt( tokens, ++i), javaCodePos, lineNumber );
break;

View File

@ -269,6 +269,11 @@ public class WatParserTest {
test( "f64.trunc" );
}
@Test
public void ref_is_null() throws IOException {
test( "ref.is_null" );
}
@Test
public void return_() throws IOException {
test( "return" );