Skip to content

Conversation

@alexcrichton
Copy link
Member

This commit fixes a bug in wast where the generated name section was invalid and placed local names on the wrong location. This happened when a function type was not listed inline for a function (e.g. it was (type $foo)) meaning that the binary translation started with the wrong local offset. The fix here is to do a lookup of the function type to see how many parameters it has and start the indexing there, or skip emitting local names if the function type doesn't exist.

This commit fixes a bug in `wast` where the generated `name` section was
invalid and placed local names on the wrong location. This happened when
a function type was not listed inline for a function (e.g. it was `(type
$foo)`) meaning that the binary translation started with the wrong local
offset. The fix here is to do a lookup of the function type to see how
many parameters it has and start the indexing there, or skip emitting
local names if the function type doesn't exist.
@alexcrichton alexcrichton requested a review from a team as a code owner November 19, 2025 22:49
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team November 19, 2025 22:49
@fitzgen fitzgen added this pull request to the merge queue Nov 19, 2025
Merged via the queue into bytecodealliance:main with commit 44b5ea4 Nov 19, 2025
34 checks passed
@alexcrichton alexcrichton deleted the fix-parse-local-names branch November 19, 2025 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants