FA-89974 / Bytecode virtual machines / Member archive
Exception tables: finally entries never match · case 04
finally blocks are skipped and errors escape methods that should run cleanup code.
Case contract
frames are ordered outermost first; the innermost frame carries the faulting pc, every caller carries the return address "ret" and the invoke opcode "via" (invokeinterface and invokedynamic are 5 bytes, other invokes 3), and the lookup pc is the invoke's own address. Each table entry [start, end, handler, type] covers start <= pc < end; entries are tried in table order; type None catches anything, otherwise the thrown type or any ancestor (parents map) must equal it. Return handler, number of frames unwound and the operand stack at the handler (cleared, then the exception pushed).
Why this case matters
Exception dispatch correctness depends on half-open ranges, table order, type hierarchy and pc attribution.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| any-type entry catches errors | {"handler": null, "stack": [], "unwound": 1} | {"handler": 400, "stack": ["StackOverflowError"], "unwound": 0} | 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 ↗