summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGoktug Gokdogan <goktug@google.com>2022-09-19 11:06:14 -0700
committerGitHub <noreply@github.com>2022-09-19 11:06:14 -0700
commit854c4efc619bc7caa1a1d53efceece477959092e (patch)
treeb6e8633d6822b14db66cba16349f649dddee7b26 /src
parent4e24fdfd74347dc40ba32efee6b154e6ec9827c0 (diff)
downloadbinaryen-854c4efc619bc7caa1a1d53efceece477959092e.tar.gz
binaryen-854c4efc619bc7caa1a1d53efceece477959092e.tar.bz2
binaryen-854c4efc619bc7caa1a1d53efceece477959092e.zip
Fix the side effects of the string encode instructions (#5054)
Diffstat (limited to 'src')
-rw-r--r--src/ir/effects.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h
index aa8a458d0..4b8c9a921 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -770,6 +770,19 @@ private:
void visitStringEncode(StringEncode* curr) {
// traps when ref is null or we write out of bounds.
parent.implicitTrap = true;
+ switch (curr->op) {
+ case StringEncodeUTF8:
+ case StringEncodeWTF8:
+ case StringEncodeWTF16:
+ parent.writesMemory = true;
+ break;
+ case StringEncodeUTF8Array:
+ case StringEncodeWTF8Array:
+ case StringEncodeWTF16Array:
+ parent.writesArray = true;
+ break;
+ default: {}
+ }
}
void visitStringConcat(StringConcat* curr) {
// traps when an input is null.