diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/type-updating.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir/type-updating.cpp b/src/ir/type-updating.cpp index 54a83aa49..312540b53 100644 --- a/src/ir/type-updating.cpp +++ b/src/ir/type-updating.cpp @@ -37,6 +37,10 @@ void handleNonNullableLocals(Function* func, Module& wasm) { Builder builder(wasm); for (auto** getp : FindAllPointers<LocalGet>(func->body).list) { auto* get = (*getp)->cast<LocalGet>(); + if (!func->isVar(get->index)) { + // We do not need to process params, which can legally be non-nullable. + continue; + } auto type = func->getLocalType(get->index); if (type.isRef() && !type.isNullable()) { // The get should now return a nullable value, and a ref.as_non_null |