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
7 changes: 1 addition & 6 deletions src/wasm-validator.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,7 @@ struct WasmValidator : public PostWalker<WasmValidator, Visitor<WasmValidator>>
}

void visitDrop(Drop* curr) {
// TODO: assert on this, when tests pass
if (getenv("BINARYEN_WARN_DROP")) {
if (!(isConcreteWasmType(curr->value->type) || curr->value->type == unreachable)) {
std::cerr << "warning: bad drop " << curr << " in " << (getFunction() ? getFunction()->name : Name("?")) << '\n';
}
}
shouldBeTrue(isConcreteWasmType(curr->value->type) || curr->value->type == unreachable, curr, "can only drop a valid value");
}

void visitReturn(Return* curr) {
Expand Down
16 changes: 8 additions & 8 deletions test/passes/vacuum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,17 @@
)
(func $if-drop (type $3) (result i32)
(block $out
(drop
(if
(call $if-drop)
(if
(call $if-drop)
(drop
(call $int)
(br $out)
)
(br $out)
)
(drop
(if
(call $if-drop)
(br $out)
(if
(call $if-drop)
(br $out)
(drop
(call $int)
)
)
Expand Down
6 changes: 4 additions & 2 deletions test/passes/vacuum.wast
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,15 @@
(func $if-drop (result i32)
(block $out
(drop
(if (call $if-drop)
(if i32
(call $if-drop)
(call $int)
(br $out)
)
)
(drop
(if (call $if-drop)
(if i32
(call $if-drop)
(br $out)
(call $int)
)
Expand Down