summaryrefslogtreecommitdiff
path: root/src/tools/wasm-ctor-eval.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-08-06 14:25:04 -0400
committerGitHub <noreply@github.com>2024-08-06 18:25:04 +0000
commitd5a5425c0c76cfc08711b81d6ec70c3a2879e405 (patch)
treecb8f2dae76598416e833c1818438a46bf7666e19 /src/tools/wasm-ctor-eval.cpp
parenta985e16832f86cbc42eb6488e6f9fc2a9eff7dc7 (diff)
downloadbinaryen-d5a5425c0c76cfc08711b81d6ec70c3a2879e405.tar.gz
binaryen-d5a5425c0c76cfc08711b81d6ec70c3a2879e405.tar.bz2
binaryen-d5a5425c0c76cfc08711b81d6ec70c3a2879e405.zip
Restore isString type methods (#6815)
PR ##6803 proposed removing Type::isString and HeapType::isString in favor of more explicit, verbose callsites. There was no consensus to make this change, but it was accidentally committed as part of #6804. Revert the accidental change, except for the useful, noncontroversial parts, such as fixing the `isString` implementation and a few other locations to correctly handle shared types.
Diffstat (limited to 'src/tools/wasm-ctor-eval.cpp')
-rw-r--r--src/tools/wasm-ctor-eval.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp
index 11fee72fb..22e666a52 100644
--- a/src/tools/wasm-ctor-eval.cpp
+++ b/src/tools/wasm-ctor-eval.cpp
@@ -841,8 +841,7 @@ public:
// externalized i31s) can be handled by the general makeConstantExpression
// logic (which knows how to handle externalization, for i31s; and it also
// can handle string constants).
- if (!value.isData() ||
- value.type.getHeapType().isMaybeShared(HeapType::string)) {
+ if (!value.isData() || value.isString()) {
return builder.makeConstantExpression(original);
}