summaryrefslogtreecommitdiff
path: root/src/ir/global-utils.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-06-09 14:46:21 -0700
committerGitHub <noreply@github.com>2021-06-09 14:46:21 -0700
commitd8877922143219eada93568074f2a262de62d04f (patch)
tree5b5c46c4c41325643be07395bc5194df4793d928 /src/ir/global-utils.h
parentcdc1bb3406f40bdab918749d020e0ef03942434d (diff)
downloadbinaryen-d8877922143219eada93568074f2a262de62d04f.tar.gz
binaryen-d8877922143219eada93568074f2a262de62d04f.tar.bz2
binaryen-d8877922143219eada93568074f2a262de62d04f.zip
[Wasm GC] Support struct.new in global initializers (#3930)
Diffstat (limited to 'src/ir/global-utils.h')
-rw-r--r--src/ir/global-utils.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir/global-utils.h b/src/ir/global-utils.h
index 053eb0456..0d91dcbb5 100644
--- a/src/ir/global-utils.h
+++ b/src/ir/global-utils.h
@@ -63,7 +63,8 @@ inline bool canInitializeGlobal(const Expression* curr) {
return true;
}
return Properties::isSingleConstantExpression(curr) ||
- curr->is<GlobalGet>() || curr->is<RttCanon>() || curr->is<RttSub>();
+ curr->is<GlobalGet>() || curr->is<RttCanon>() || curr->is<RttSub>() ||
+ curr->is<StructNew>();
}
} // namespace GlobalUtils