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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index 52a4be2d4..6febcf6b9 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -590,6 +590,13 @@ struct Reducer
tryToReplaceCurrent(loop->body);
}
return; // nothing more to do
+ } else if (curr->is<Drop>()) {
+ if (curr->type == Type::none) {
+ // We can't improve this: the child has a different type than us. Return
+ // here to avoid reaching the code below that tries to add a drop on
+ // children (which would recreate the current state).
+ return;
+ }
}
// Finally, try to replace with a child.
for (auto* child : ChildIterator(curr)) {