-
Notifications
You must be signed in to change notification settings - Fork 251
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
wasmparser static TypeId
assert can trigger with -Zrandomize-layout
#1013
Comments
repi
changed the title
wasmparser static
wasmparser static May 3, 2023
TypeId
assert can trigger when building with -Zrandomize-layout
TypeId
assert can trigger with -Zrandomize-layout
Oh dear sorry for the breakage! I think it's probably best to use |
repi
added a commit
to EmbarkStudios/wasm-tools
that referenced
this issue
May 5, 2023
When compiling with `-Zrandomize-layout` the fields of `TypeId` can be rearranged in a way where the type becomes larger than 16 bytes which triggered a static assert. Resolves: bytecodealliance#1013
alexcrichton
pushed a commit
that referenced
this issue
May 15, 2023
Mossaka
pushed a commit
to Mossaka/wasm-tools-fork
that referenced
this issue
May 29, 2023
* Freeze field layout of `TypeId` When compiling with `-Zrandomize-layout` the fields of `TypeId` can be rearranged in a way where the type becomes larger than 16 bytes which triggered a static assert. Resolves: bytecodealliance#1013 * Add comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following wasmparser code can fail if compiling with nightly and
-Zrandomize-layout
due to a static assert triggering on the size ofTypeId
when the field order gets reshuffled.should we increase the limit her, remove the assert, or use
repr(C)
onTypeId
to enforce the field order of this type?We ran into this when building our application with nightly and
-Zrandomize-layout
which builds all dependent crates including wasmtime and wasmparser with it as well and this failed to build. Another option could be to move the assert to a unit test so it only gets triggered in the development of wasmparser and not in usages of the crate?The text was updated successfully, but these errors were encountered: