diff options
author | Alon Zakai <azakai@google.com> | 2024-03-22 13:20:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-22 20:20:47 +0000 |
commit | f40e90aa2ae7c56d534d1c2b74ea173a85ce4039 (patch) | |
tree | 0876efcf61f9aeedb191b5ff350b07e5308acf58 /src/tools/fuzzing/fuzzing.cpp | |
parent | 2471301a5209724b1ea32fab36b13410e96c0af9 (diff) | |
download | binaryen-f40e90aa2ae7c56d534d1c2b74ea173a85ce4039.tar.gz binaryen-f40e90aa2ae7c56d534d1c2b74ea173a85ce4039.tar.bz2 binaryen-f40e90aa2ae7c56d534d1c2b74ea173a85ce4039.zip |
Precompute: Mark StringEncode as non-removable, just like ArrayCopy (#6423)
The only StringEncode we support is the one that writes into an array, so it
has the same effects as ArrayCopy. Precompute needs to be made aware of
such side effects in a manual manner (as we already do for ArrayCopy etc.):
it simply tries to execute code in the interpreter, and if it succeeds it replaces;
it does not check for side effects (checking for side effects would prevent
optimizing cases where the side effects do not happen, as we check them
statically, e.g. dividing by a non-zero constant does not trap but a division
would be seen as having a potential trap effect).
I verified no other string operation is hit by this: all the others
emit or operate on immutable strings; it is just StringEncode that is basically
an Array operation that appears in the Strings proposal.)
Diffstat (limited to 'src/tools/fuzzing/fuzzing.cpp')
0 files changed, 0 insertions, 0 deletions