diff options
author | Alon Zakai <azakai@google.com> | 2022-09-19 16:07:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 16:07:05 -0700 |
commit | cac995816b1b7051e3984e92d546207545d44327 (patch) | |
tree | 223042d80b957dd901844533e084f846add7d8fb /src | |
parent | bd76598f8525e15d6649335e1308a27284c4b0ae (diff) | |
download | binaryen-cac995816b1b7051e3984e92d546207545d44327.tar.gz binaryen-cac995816b1b7051e3984e92d546207545d44327.tar.bz2 binaryen-cac995816b1b7051e3984e92d546207545d44327.zip |
[Strings] Add missing String effects + tests (#5057)
Also fix some formatting issue in the file.
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/effects.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index c2ba794d9..63d9fafc5 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -592,7 +592,8 @@ private: parent.implicitTrap = true; break; } - default: {} + default: { + } } } void visitBinary(Binary* curr) { @@ -621,7 +622,8 @@ private: } break; } - default: {} + default: { + } } } void visitSelect(Select* curr) {} @@ -783,6 +785,22 @@ private: void visitStringNew(StringNew* curr) { // traps when out of bounds in linear memory or ref is null parent.implicitTrap = true; + switch (curr->op) { + case StringNewUTF8: + case StringNewWTF8: + case StringNewReplace: + case StringNewWTF16: + parent.readsMemory = true; + break; + case StringNewUTF8Array: + case StringNewWTF8Array: + case StringNewReplaceArray: + case StringNewWTF16Array: + parent.readsArray = true; + break; + default: { + } + } } void visitStringConst(StringConst* curr) {} void visitStringMeasure(StringMeasure* curr) { @@ -803,7 +821,8 @@ private: case StringEncodeWTF16Array: parent.writesArray = true; break; - default: {} + default: { + } } } void visitStringConcat(StringConcat* curr) { |