Skip to content

Fix regression with instantiateWasm + MODULARIZE + Asyncify #24032

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

Conversation

caiiiycuk
Copy link
Contributor

While updating to the latest emcc, I found a regression that affects MODULARIZE + Asyncify, but not only. I bisected and identified the problematic set of commits:

https://chromium.googlesource.com/external/github.com/emscripten-core/emscripten.git/+log/7924a238f187..ec40bc528ea6

As you can see, in these changes, instantiateWasm resolves with mod.exports, which is incorrect because receiveInstance modifies the exports and returns the modified version. For example, in the case of Asyncify, using the original exports leads to exceptions inside the Asyncify code because the exports are not instrumented.

The fix is trivial—if you agree with my assessment, I can also add a test case.

@caiiiycuk
Copy link
Contributor Author

Ah, I should have checked existing PRs first—this is a duplicate of #23781, so I’m closing it.

@caiiiycuk caiiiycuk closed this Apr 2, 2025
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.

1 participant