summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-04-18 12:26:57 -0700
committerGitHub <noreply@github.com>2024-04-18 12:26:57 -0700
commitd39b4fa0df1115bf4ba253814ac2c58258aab3b2 (patch)
treea6c21b7ca2582845529b5788095521d65687d0b8 /src
parent3fd5c4f3dfc0fc2ccd1dc5ed39e4f0ffb46c10b8 (diff)
downloadbinaryen-d39b4fa0df1115bf4ba253814ac2c58258aab3b2.tar.gz
binaryen-d39b4fa0df1115bf4ba253814ac2c58258aab3b2.tar.bz2
binaryen-d39b4fa0df1115bf4ba253814ac2c58258aab3b2.zip
[Strings] Fix finalize() of StringNew on arrays (#6511)
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index c2df2c68c..9bc0f6e0b 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -1249,7 +1249,9 @@ void RefAs::finalize() {
void StringNew::finalize() {
if (ptr->type == Type::unreachable ||
- (length && length->type == Type::unreachable)) {
+ (length && length->type == Type::unreachable) ||
+ (start && start->type == Type::unreachable) ||
+ (end && end->type == Type::unreachable)) {
type = Type::unreachable;
} else {
type = Type(HeapType::string, try_ ? Nullable : NonNullable);