summaryrefslogtreecommitdiff
path: root/src/wasm/wasm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r--src/wasm/wasm.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index f3e345895..c3f262998 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -1057,7 +1057,13 @@ void ArrayNew::finalize() {
}
}
-void ArrayNewSeg::finalize() {
+void ArrayNewData::finalize() {
+ if (offset->type == Type::unreachable || size->type == Type::unreachable) {
+ type = Type::unreachable;
+ }
+}
+
+void ArrayNewElem::finalize() {
if (offset->type == Type::unreachable || size->type == Type::unreachable) {
type = Type::unreachable;
}
@@ -1118,7 +1124,16 @@ void ArrayFill::finalize() {
}
}
-void ArrayInit::finalize() {
+void ArrayInitData::finalize() {
+ if (ref->type == Type::unreachable || index->type == Type::unreachable ||
+ offset->type == Type::unreachable || size->type == Type::unreachable) {
+ type = Type::unreachable;
+ } else {
+ type = Type::none;
+ }
+}
+
+void ArrayInitElem::finalize() {
if (ref->type == Type::unreachable || index->type == Type::unreachable ||
offset->type == Type::unreachable || size->type == Type::unreachable) {
type = Type::unreachable;