From 9035a40566cf349d3b210be1fb03052d2b05d321 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 4 Oct 2016 15:39:44 -0700 Subject: [PATCH 1/2] Binary 0xc: Remove arity on return instruction Also skip binary roundtrip on stacky spec tests --- check.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check.py b/check.py index 9c10e49b605..f4891d8e9b5 100755 --- a/check.py +++ b/check.py @@ -433,6 +433,8 @@ def fix(x): # we must ignore some binary format splits splits_to_skip = { + 'func.wast': [2], + 'return.wast': [2] } # check binary format. here we can verify execution of the final result, no need for an output verification From 60496319447d562e670fe733ffb0bba2a7e2e4b6 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 4 Oct 2016 15:41:09 -0700 Subject: [PATCH 2/2] Missed wasm-binary.h --- src/wasm-binary.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 8e9534973a0..dcbe7d6db68 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -1313,7 +1313,7 @@ class WasmBinaryWriter : public Visitor { if (curr->value) { recurse(curr->value); } - o << int8_t(BinaryConsts::Return) << U32LEB(curr->value ? 1 : 0); + o << int8_t(BinaryConsts::Return); } void visitHost(Host *curr) { if (debug) std::cerr << "zz node: Host" << std::endl; @@ -2378,9 +2378,7 @@ class WasmBinaryBuilder { } void visitReturn(Return *curr) { if (debug) std::cerr << "zz node: Return" << std::endl; - auto arity = getU32LEB(); - assert(arity == 0 || arity == 1); - if (arity == 1) { + if (currFunction->result != none) { curr->value = popExpression(); } }