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

Don't rely on the name section for detecting main #3364

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

Liamolucko
Copy link
Collaborator

Fixes #3362

In some cases, the name section can fail to be parsed because one of the names is too long, which then causes the main function to not be detected because we don't know what any functions' names are.

However, main is also exported with the name main, so we can look for an export named main instead to avoid relying on the name section.

Fixes rustwasm#3362

In some cases, the name section can fail to be parsed because one of the names is too long, which then causes the main function to not be detected because we don't know what any functions' names are.

However, `main` is also exported with the name `main`, so we can look for an export named `main` instead to avoid relying on the name section.
@alexcrichton alexcrichton merged commit bea9bdb into rustwasm:main Mar 24, 2023
@Liamolucko Liamolucko deleted the main-no-name-section branch March 24, 2023 22:43
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.

Functions with extermely long names can cause wasm-bindgen to fail to locate the main function
2 participants