FAILURE MAP
← Case archive

FA-90162 / Bytecode virtual machines / Member archive

LEB128 immediates: decoding stops on continuation bytes · case 02

Multi-byte immediates are cut after their first byte and single-byte ones swallow the next operand.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

Decode consecutive LEB128 immediates of kinds u32, s32, u64, s64 from a byte list: 7 payload bits per byte, least significant group first, bit 0x80 means another byte follows; at most ceil(bits/7) bytes (5 for 32-bit, 10 for 64-bit). Signed kinds sign-extend from bit 0x40 of the final byte; u32/s32 values outside their range are errors. Return decoded values followed by the first error, if any: ["unexpected-end", pos], ["too-long", pos] or ["out-of-range", pos].

Why this case matters

Compact bytecode formats encode immediates with LEB128; decoding errors silently change operands.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: mixed immediates[85, -3313, ["unexpected-end", 5]][2005, -154, -1]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗