Skip to content

Conversation

@zherczeg
Copy link
Contributor

@zherczeg zherczeg commented Nov 22, 2025

Clear "reference is set" bitset and hasmap in BeginFunctionBody.
Furtermore support try_tables.

Fixes: #2670

Clear "reference is set" bitset and hasmap in BeginFunctionBody
Furtermore support try_tables
@sbc100 sbc100 merged commit ade2a41 into WebAssembly:main Nov 23, 2025
17 checks passed
@sbc100
Copy link
Member

sbc100 commented Nov 23, 2025

Thanks for the quick fix!

TypeVector param_types, result_types;
result |= CheckBlockSignature(loc, Opcode::TryTable, sig_type, &param_types,
&result_types);
RestoreLocalRefs(result);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized I misunderstood how BeginTryTable/EndTryTable work. This is a new part of the code for me. BinaryReaderInterp::OnTryTableExpr calls EndTryTable after catch blocks are processed, not after the end.

In this case this is not needed (although harmless), and the normal OnEnd should call RestoreLocalRefs (it does).
I am sorry, I will submit another fix.

@zherczeg zherczeg deleted the ref_map_fix branch November 23, 2025 04:11
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.

Assertion `local_ref_is_set_.size() == label->local_ref_is_set_.size()' failed at wasm-interp

2 participants