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

Memory packing is not safe with imported memory #2423

Open
tlively opened this issue Nov 6, 2019 · 1 comment
Open

Memory packing is not safe with imported memory #2423

tlively opened this issue Nov 6, 2019 · 1 comment

Comments

@tlively
Copy link
Member

tlively commented Nov 6, 2019

The MemoryPacking pass assumes that the initial memory is zero, so it is free to remove spans of zeroes from active segments. This is not technically true with an imported memory. Do we care? This has not been a problem in practice because toolchains generally assume that memory is fresh and owned by the wasm module.

@kripken
Copy link
Member

kripken commented Nov 6, 2019

Good point. We should perhaps make variations on the pass that either make that assumption or do not, but a downside is that most code will likely assume this, so forcing people to opt-in means some would miss out. Still, it's probably the right thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants