Stream: git-wasmtime

Topic: wasmtime / PR #12140 Fix `#[derive(Lift)]` for enums of 2...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2025 at 15:39):

alexcrichton opened PR #12140 from alexcrichton:fix-fuzz to bytecodealliance:main:

This commit fixes a longstanding bug in the implementation of #[derive(Lift)] which was found by the component_api fuzzer recently. Specifically when an enum or variant had exactly 256 cases the comparison of the discriminant for being out-of-bounds was done in the n-bit space of the discriminant rather than a bit-space that can hold the entire discriminant. The fix here is to compare with a u32 instead of a u8 to ensure that if there are 256 variants it actually compares against 256 instead of 0 by accident.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2025 at 15:39):

alexcrichton requested pchickey for a review on PR #12140.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2025 at 15:39):

alexcrichton requested wasmtime-core-reviewers for a review on PR #12140.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2025 at 15:39):

alexcrichton commented on PR #12140:

I'll note test-wise I opted against adding a test here because it'd be a very large test with 256 wit cases, 256 wat cases, 256 rust cases, etc, so I figured we could lean on the fuzzers here instead.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2025 at 17:29):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2025 at 17:53):

alexcrichton merged PR #12140.


Last updated: Dec 13 2025 at 19:03 UTC