summaryrefslogtreecommitdiff
path: root/src/ir/global-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/global-utils.h')
-rw-r--r--src/ir/global-utils.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ir/global-utils.h b/src/ir/global-utils.h
index 7dc4c6af3..053eb0456 100644
--- a/src/ir/global-utils.h
+++ b/src/ir/global-utils.h
@@ -56,13 +56,14 @@ getGlobalInitializedToImport(Module& wasm, Name module, Name base) {
inline bool canInitializeGlobal(const Expression* curr) {
if (auto* tuple = curr->dynCast<TupleMake>()) {
for (auto* op : tuple->operands) {
- if (!Properties::isSingleConstantExpression(op) && !op->is<GlobalGet>()) {
+ if (!canInitializeGlobal(op)) {
return false;
}
}
return true;
}
- return Properties::isSingleConstantExpression(curr) || curr->is<GlobalGet>();
+ return Properties::isSingleConstantExpression(curr) ||
+ curr->is<GlobalGet>() || curr->is<RttCanon>() || curr->is<RttSub>();
}
} // namespace GlobalUtils