Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of table imports #6446

Merged
merged 3 commits into from
Mar 27, 2024
Merged

Conversation

vouillon
Copy link
Contributor

The types was ignored and funcref was always used instead.

The types was ignored and `funcref` was always used instead.
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

FWIW, we will soon be switching to the next wat parser --new-wat-parser, which should already implement this correctly.

@vouillon
Copy link
Contributor Author

I have added a test in #6437 which would fail without this change...

if (!table->type.isRef()) {
throw SParseException("Only reference types are valid for tables", s);
}

wasm.addTable(std::move(table));

j++; // funcref
Copy link
Member

Choose a reason for hiding this comment

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

Should this line not be removed? We increment j on line 3740 now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, indeed!

@kripken kripken enabled auto-merge (squash) March 27, 2024 18:33
@kripken kripken merged commit 61877e9 into WebAssembly:main Mar 27, 2024
14 checks passed
@vouillon vouillon deleted the table-import-fix branch March 28, 2024 20:29
@gkdn gkdn mentioned this pull request Aug 31, 2024
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.

3 participants