FA-89908 / Bytecode virtual machines / Member archive
Stack-depth verifier: ifeq leaves its condition on the stack · case 03
Both branch targets are verified one slot too deep and max stack is overstated.
Case contract
code is a list of [op, arg]. Stack effects (required, delta): push (0,+1), pop (1,-1), dup (1,+1), dup_x1 (2,+1), swap (2,0), add (2,-1), ifeq (1,-1; successors fallthrough and arg), goto (0,0; only arg), return (1,-1; none). Dataflow from index 0 with depth 0: report ["underflow", i], ["falls-off", i] for a successor outside the code, ["inconsistent", s] when a merge sees two depths, else ["ok", max depth]. Unreachable code is never examined.
Why this case matters
Bytecode verifiers must agree exactly on stack effects and control-flow successors.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| if/else arms merge at equal depth | ["ok", 2] | ["ok", 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 ↗