cfallin requested elliottt for a review on PR #8173.
cfallin opened PR #8173 from cfallin:fix-pcc-iconst
to bytecodealliance:main
:
We have various constant-propagation/folding rules in the mid-end that generate new
iconst
s in place of other expressions. We got a fuzzbug with PCC wherein it was not able to verify that an iadd-iadd-uextend combination generating a Wasm address was in-range when rules reassociated the iadds to put constants together. Rather than carefully augment all rules to propagate constant facts only where they exist on the inputs, I opted to add a hook to the optimizer to generate brand-new assertions on all iconsts that we insert. This adds a little more work during verification (not too much hopefully: it's pretty low-overhead to check thatmov $1, %rax
puts1
inrax
) but should provide broader coverage of interesting corner-cases where optimization breaks the PCC chain.Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=67432.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
cfallin requested wasmtime-compiler-reviewers for a review on PR #8173.
jameysharp submitted PR review:
This one is easy enough to reason about: it passes the flags through so we can check whether we're using PCC, and if we are, it does what the commit message says.
cfallin merged PR #8173.
Last updated: Nov 22 2024 at 17:03 UTC