diff options
Diffstat (limited to 'src/ir/module-utils.cpp')
-rw-r--r-- | src/ir/module-utils.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ir/module-utils.cpp b/src/ir/module-utils.cpp index 1efbe490a..490955866 100644 --- a/src/ir/module-utils.cpp +++ b/src/ir/module-utils.cpp @@ -448,7 +448,10 @@ InsertOrderedMap<HeapType, HeapTypeInfo> collectHeapTypeInfo( for (auto type : func->vars) { info.note(type); } - if (!func->imported()) { + // Don't just use `func->imported()` here because we also might be + // printing an error message on a partially parsed module whose declared + // function bodies have not all been parsed yet. + if (func->body) { CodeScanner(wasm, info, inclusion).walk(func->body); } }); |