summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir/ExpressionAnalyzer.cpp2
-rw-r--r--src/passes/Precompute.cpp9
-rw-r--r--src/tools/execution-results.h5
3 files changed, 10 insertions, 6 deletions
diff --git a/src/ir/ExpressionAnalyzer.cpp b/src/ir/ExpressionAnalyzer.cpp
index cdbcd9ae0..d2f9611f9 100644
--- a/src/ir/ExpressionAnalyzer.cpp
+++ b/src/ir/ExpressionAnalyzer.cpp
@@ -219,7 +219,7 @@ template<typename T> void visitImmediates(Expression* curr, T& visitor) {
visitor.visitInt(curr->op);
visitor.visitNonScopeName(curr->nameOperand);
}
- void visitRefNull(RefNull* curr) {}
+ void visitRefNull(RefNull* curr) { visitor.visitType(curr->type); }
void visitRefIsNull(RefIsNull* curr) {}
void visitRefFunc(RefFunc* curr) { visitor.visitNonScopeName(curr->func); }
void visitTry(Try* curr) {}
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index 0b67a25aa..d8a1fa9fc 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -134,9 +134,12 @@ struct Precompute
curr->finalize();
return;
}
- } else if (singleValue.isNull() &&
- curr->value->template is<RefNull>()) {
- return;
+ } else if (singleValue.isNull()) {
+ if (auto* n = curr->value->template dynCast<RefNull>()) {
+ n->finalize(singleValue.type);
+ curr->finalize();
+ return;
+ }
} else if (singleValue.type == Type::funcref) {
if (auto* r = curr->value->template dynCast<RefFunc>()) {
r->func = singleValue.getFunc();
diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h
index c41b0c208..0881163f1 100644
--- a/src/tools/execution-results.h
+++ b/src/tools/execution-results.h
@@ -73,7 +73,7 @@ struct ExecutionResults {
// change (after duplicate function elimination or roundtripping)
// while the function contents are still the same
for (Literal& val : ret) {
- if (val.type == Type::funcref) {
+ if (val.type == Type::funcref && !val.isNull()) {
val = Literal::makeFunc(Name("funcref"));
}
}
@@ -112,7 +112,8 @@ struct ExecutionResults {
}
std::cout << "[fuzz-exec] comparing " << name << '\n';
if (results[name] != other.results[name]) {
- std::cout << "not identical!\n";
+ std::cout << "not identical! " << results[name]
+ << " != " << other.results[name] << "\n";
return false;
}
}