summaryrefslogtreecommitdiff
path: root/src/passes/Precompute.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Precompute.cpp')
-rw-r--r--src/passes/Precompute.cpp9
1 files changed, 6 insertions, 3 deletions
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();