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

Align type size calculation in wasmparser/wasm-smith #274

Merged
merged 1 commit into from
May 19, 2021

Conversation

alexcrichton
Copy link
Member

This commit updates the type size calculation in wasmparser to more
closely align with that of wasm-smith. Previously wasmparser would
conservatively say that the type size of the instance of an instantiated
module was the same as that of the module that was being instantiated,
but wasm-smith only considered the size of the exports. Additionally the
+1 for each item happened in wasm-smith outside of the size
calculation rather than inside.

This fixes both of these issues in wasmparser's validator, the main fix
being having instances count far less towards the type size budget
because the imports of the instantiated module are no longer considered
in the type size of the instance itself.

This commit updates the type size calculation in wasmparser to more
closely align with that of wasm-smith. Previously wasmparser would
conservatively say that the type size of the instance of an instantiated
module was the same as that of the module that was being instantiated,
but wasm-smith only considered the size of the exports. Additionally the
`+1` for each item happened in wasm-smith outside of the `size`
calculation rather than inside.

This fixes both of these issues in wasmparser's validator, the main fix
being having instances count far less towards the type size budget
because the imports of the instantiated module are no longer considered
in the type size of the instance itself.
@fitzgen fitzgen merged commit f632261 into bytecodealliance:main May 19, 2021
@alexcrichton alexcrichton deleted the type-size-align branch July 6, 2022 14:28
alexcrichton pushed a commit to alexcrichton/wasm-tools that referenced this pull request Nov 16, 2022
Closes bytecodealliance#274

Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
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.

2 participants