Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/wasm-binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ class WasmBinaryWriter : public Visitor<WasmBinaryWriter, void> {
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;
Expand Down Expand Up @@ -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();
}
}
Expand Down