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.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index a832c9e85..44227a50f 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -350,8 +350,10 @@ private:
Literals curr;
if (set == nullptr) {
if (getFunction()->isVar(get->index)) {
- curr =
- Literal::makeZeros(getFunction()->getLocalType(get->index));
+ auto localType = getFunction()->getLocalType(get->index);
+ assert(!localType.isNonNullable() &&
+ "Non-nullable locals must not use the default value");
+ curr = Literal::makeZeros(localType);
} else {
// it's a param, so it's hopeless
values = {};