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.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index ac00ce045..6ba5c5b83 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -566,14 +566,14 @@ struct Reducer
}
}
}
- // If that didn't work, try to replace with a child + a unary conversion
- if (curr->type.isConcrete() &&
- !curr->is<Unary>()) { // but not if it's already unary
+ // If that didn't work, try to replace with a child + a unary conversion,
+ // but not if it's already unary
+ if (curr->type.isSingle() && !curr->is<Unary>()) {
for (auto* child : ChildIterator(curr)) {
if (child->type == curr->type) {
continue; // already tried
}
- if (!child->type.isConcrete()) {
+ if (!child->type.isSingle()) {
continue; // no conversion
}
Expression* fixed = nullptr;
@@ -1013,6 +1013,11 @@ struct Reducer
RefNull* n = builder->makeRefNull();
return tryToReplaceCurrent(n);
}
+ if (curr->type.isMulti()) {
+ Expression* n =
+ builder->makeConstExpression(Literal::makeZero(curr->type));
+ return tryToReplaceCurrent(n);
+ }
Const* c = builder->makeConst(Literal(int32_t(0)));
if (tryToReplaceCurrent(c)) {
return true;