Avoid overflow in component ABI size calculations - #14058
Conversation
|
This feel s a bit too coarse to me to just slap |
Signed-off-by: subotac <73706465+subotac@users.noreply.github.com>
|
|
Thanks for the updates, but reading over this again I continue to be left with a bit of unease about fixing this issue here. I think I'd personally prefer to go the route of WebAssembly/component-model#682 and fix this at the component-model validation layer rather than in a bit of an ad-hoc fashion within Wasmtime here. I'd ideally like to take that as an opportunity to flesh out the tests here and expand them, too. I don't believe that this is is a major issue for preexisting components and currently the only issue is when dealing with fixed-length-lists, so I think it's ok to leave this un-fixed on |
Fixes #13980.
Preserve the canonical ABI size overflow sentinel when aligning and composing record and variant layouts and when advancing field offsets.
Add regression coverage for dynamic and const record/variant layouts and 32-/64-bit field offsets.
Tests:
cargo test -p wasmtime-environ --features component-modelcargo clippy -p wasmtime-environ --features component-model --all-targets -- -D warningscargo fmt -p wasmtime-environ -- --check