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.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index cddf8785f..a08848810 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -442,10 +442,18 @@ private:
if (getFunction()->isVar(get->index)) {
auto localType = getFunction()->getLocalType(get->index);
if (localType.isNonNullable()) {
- Fatal() << "Non-nullable local accessing the default value in "
- << getFunction()->name << " (" << get->index << ')';
+ // This is a non-nullable local that seems to read the default
+ // value at the function entry. This is either an internal error
+ // or a case of unreachable code; the latter is possible as
+ // LocalGraph is not precise in unreachable code.
+ //
+ // We cannot set zeros here (as applying them, even in
+ // unreachable code, would not validate), so just mark this as
+ // a hopeless case to ignore.
+ values = {};
+ } else {
+ curr = Literal::makeZeros(localType);
}
- curr = Literal::makeZeros(localType);
} else {
// it's a param, so it's hopeless
values = {};