From 854c4efc619bc7caa1a1d53efceece477959092e Mon Sep 17 00:00:00 2001 From: Goktug Gokdogan Date: Mon, 19 Sep 2022 11:06:14 -0700 Subject: Fix the side effects of the string encode instructions (#5054) --- src/ir/effects.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') 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. -- cgit v1.2.3