summaryrefslogtreecommitdiff
path: root/src/tools/wasm-reduce.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm-reduce.cpp')
-rw-r--r--src/tools/wasm-reduce.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index bd5a0c1b8..36a44b056 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -508,7 +508,11 @@ struct Reducer : public WalkerPass<PostWalker<Reducer, UnifiedExpressionVisitor<
}
// Finally, try to replace with a child.
for (auto* child : ChildIterator(curr)) {
- if (tryToReplaceCurrent(child)) return;
+ if (isConcreteType(child->type) && curr->type == none) {
+ if (tryToReplaceCurrent(builder->makeDrop(child))) return;
+ } else {
+ if (tryToReplaceCurrent(child)) return;
+ }
}
// If that didn't work, try to replace with a child + a unary conversion
if (isConcreteType(curr->type) &&