From 9fbfe0f200f716a6c9a045c6a3f2606b99af8dea Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 10 Jun 2022 11:24:48 -0700 Subject: Include globals when collecting module types (#4717) Otherwise when a type is only used on a global, it will be incorrectly omitted from the output. --- src/ir/module-utils.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ir/module-utils.cpp b/src/ir/module-utils.cpp index bf1a45205..38bb6f3d9 100644 --- a/src/ir/module-utils.cpp +++ b/src/ir/module-utils.cpp @@ -104,6 +104,9 @@ Counts getHeapTypeCounts(Module& wasm) { // Collect module-level info. Counts counts; CodeScanner(wasm, counts).walkModuleCode(&wasm); + for (auto& curr : wasm.globals) { + counts.note(curr->type); + } for (auto& curr : wasm.tags) { counts.note(curr->sig); } -- cgit v1.2.3