diff options
author | Alon Zakai <azakai@google.com> | 2023-10-06 16:41:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-06 16:41:13 -0700 |
commit | b3775b5e4e150439276ad3d34f1bb564b28e8ef5 (patch) | |
tree | eb7b09492205249f08459ffee38e081b83cbf17d /src/passes/FuncCastEmulation.cpp | |
parent | 9c1107d17c0b7223bd377d9ab4f36fe54ef07c7d (diff) | |
download | binaryen-b3775b5e4e150439276ad3d34f1bb564b28e8ef5.tar.gz binaryen-b3775b5e4e150439276ad3d34f1bb564b28e8ef5.tar.bz2 binaryen-b3775b5e4e150439276ad3d34f1bb564b28e8ef5.zip |
Automatically discard global effects in the rare passes that add effects (#5999)
All logging/instrumentation passes need to do this, to avoid us using stale
global effects that are too low (too high is not optimal either, but at least it
cannot cause bugs).
Diffstat (limited to 'src/passes/FuncCastEmulation.cpp')
-rw-r--r-- | src/passes/FuncCastEmulation.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/FuncCastEmulation.cpp b/src/passes/FuncCastEmulation.cpp index 3255208fe..23eb98a8c 100644 --- a/src/passes/FuncCastEmulation.cpp +++ b/src/passes/FuncCastEmulation.cpp @@ -151,6 +151,11 @@ private: }; struct FuncCastEmulation : public Pass { + // Changes the ABI, which alters which indirect calls will trap (normally, + // this should prevent traps, but it depends on code this is linked to at + // runtime in the case of dynamic linking etc.). + bool addsEffects() override { return true; } + void run(Module* module) override { Index numParams = std::stoul( getPassOptions().getArgumentOrDefault("max-func-params", "16")); |