diff options
author | Alon Zakai <azakai@google.com> | 2022-04-28 09:56:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 16:56:58 +0000 |
commit | 7ba0d8377dfaa9fbd24c0e5961fd2795d8349272 (patch) | |
tree | 94c74b52c30e62aa93035a1bc0bf10ed87363b63 /src/passes/SignatureRefining.cpp | |
parent | 0b0581a2db2ea0f28e820957504e431881cb1f70 (diff) | |
download | binaryen-7ba0d8377dfaa9fbd24c0e5961fd2795d8349272.tar.gz binaryen-7ba0d8377dfaa9fbd24c0e5961fd2795d8349272.tar.bz2 binaryen-7ba0d8377dfaa9fbd24c0e5961fd2795d8349272.zip |
[NominalFuzzing] SignatureRefining can modify the IR while running a parallel analysis (#4620)
Normally ParallelFunctionAnalysis is just an analysis, and has no effects. However, in
SignatureRefining we actually do have side effects, due to an internal limitation of the
helper code it runs. This adds a template parameter to the class so users can note that
they do modify the IR. The parameter is added in the middle as it is easier to add this
param than to add the last one (the map).
Diffstat (limited to 'src/passes/SignatureRefining.cpp')
-rw-r--r-- | src/passes/SignatureRefining.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/passes/SignatureRefining.cpp b/src/passes/SignatureRefining.cpp index d094382c7..2c2146c3f 100644 --- a/src/passes/SignatureRefining.cpp +++ b/src/passes/SignatureRefining.cpp @@ -76,7 +76,9 @@ struct SignatureRefining : public Pass { bool canModify = true; }; - ModuleUtils::ParallelFunctionAnalysis<Info> analysis( + // This analysis also modifies the wasm as it goes, as the getResultsLUB() + // operation has side effects (see comment on header declaration). + ModuleUtils::ParallelFunctionAnalysis<Info, Mutable> analysis( *module, [&](Function* func, Info& info) { if (func->imported()) { return; |