summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir/possible-contents.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp
index d9c608bda..f1302b3dd 100644
--- a/src/ir/possible-contents.cpp
+++ b/src/ir/possible-contents.cpp
@@ -1234,6 +1234,13 @@ Flower::Flower(Module& wasm) : wasm(wasm) {
}
}
}
+ } else if (ex->kind == ExternalKind::Global) {
+ // Exported mutable globals are roots, since the outside may write any
+ // value to them.
+ auto name = ex->value;
+ if (wasm.getGlobal(name)->mutable_) {
+ roots[GlobalLocation{name}] = PossibleContents::many();
+ }
}
}