diff options
author | Thomas Lively <tlively@google.com> | 2024-11-14 15:20:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-14 20:20:50 +0000 |
commit | 614fc7d3a01482ec6b8d48e806e2b43524212c06 (patch) | |
tree | 5055c235a2abbb59e49d03040dcd6fa6a07fa34e /src/passes/StackCheck.cpp | |
parent | 74a910bc298c95856e5bc09fcd2424d08c5df12f (diff) | |
download | binaryen-614fc7d3a01482ec6b8d48e806e2b43524212c06.tar.gz binaryen-614fc7d3a01482ec6b8d48e806e2b43524212c06.tar.bz2 binaryen-614fc7d3a01482ec6b8d48e806e2b43524212c06.zip |
[NFC] Eagerly set local names in binary reader (#7076)
Instead of setting the local names at the end of binary reading, eagerly
set them before parsing function bodies. This is NFC now, but will fix a
future bug once the binary reader uses IRBuilder. IRBuilder can
introduce new scratch locals, and it gives them the names `$scratch`,
`$scratch_1`, etc. If the name section includes locals with the same
names and we set those local names after parsing function bodies, then
we can end up with multiple locals with the same names. Setting the
names before parsing the function bodies ensures that IRBuilder will
generate different names for the scratch locals.
The alternative fix would be to generate fresh names when setting names
from the name section, but it is better to respect the names in the name
section and use fresh names for the newly introduced scratch locals
instead.
Diffstat (limited to 'src/passes/StackCheck.cpp')
0 files changed, 0 insertions, 0 deletions