-
Notifications
You must be signed in to change notification settings - Fork 246
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
wast lexer size assert not compatible with randomized struct layouts #1750
Comments
Thanks for the report, and sorry for the breakage! Is this something that you'd prefer to see urgently fixed? If so I can work on getting a patch release out for rust-lang/rust to update to. (it's a bit nonstandard to do patch releases in this repo unfortunately but I can make it work) |
Not urgent, I can probably work around it for now by excluding a bunch of things from randomization. |
Looks like that wasn't sufficient, there are another compile time size assert: wasm-tools/crates/wast/src/core/expr.rs Lines 1211 to 1215 in 537ca81
|
There are more wasm-tools/crates/wasmparser/src/validator/types.rs Lines 109 to 111 in 537ca81
generally all such asserts should be moved to tests, otherwise the crates break under layout randomization. |
Helps to address [builds with `-Zrandomize-layout`][comment] [comment]: bytecodealliance#1750 (comment)
Oops, thanks for pointing that out! I've submitted #1894 to relax some more assertions. To confirm though, in the second case you mentioned, that assert is technically ok to leave as a const-assert right? It's an assertion about a |
Oh yeah, I didn't look at the struct declaration. That one is fine. |
Helps to address [builds with `-Zrandomize-layout`][comment] [comment]: #1750 (comment)
wasm-tools/crates/wast/src/lexer.rs
Lines 64 to 66 in d68b382
breaks when compiling with layout randomization
If the assert is necessary for correctness then
repr(C)
should be used to get a deterministic layout.If it's just an optimization then it's probably better to just check it in tests/CI.
Found this while trying to build the rust compiler with randomized layouts. rust-lang/rust#101339
The text was updated successfully, but these errors were encountered: