FAILURE MAP
← Case archive

FA-90203 / Bytecode virtual machines / Member archive

Generators: generator survives an uncaught throw · case 03

After throw() propagates out, next() resumes the dead frame and faults.

Member previewVariant 3 · 3 implementations · 9 checks per implementation

Case contract

A generator frame runs body ops push v, pop, add, yield (pop and hand out a value, suspend), return (pop, finish with StopIteration value), try exc target / endtry (handler stack; handler "Exception" catches any thrown name). Commands: next (= send None) and send v resume; resuming a suspended frame pushes the sent value as the result of its yield; sending non-None to a never-started generator is ["TypeError"]; a finished generator answers ["StopIteration", None]. throw into a created or finished generator finishes it with ["raised", exc]; otherwise the innermost matching handler is jumped to, or the generator finishes and re-raises. close finishes the generator. Frame faults are ["vm-error"].

Why this case matters

Generator state transitions (created/suspended/done) and send/throw semantics are easy to get subtly wrong.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
uncaught throw finishes the generator[["yielded", 1], ["raised", "KeyError"], ["vm-error"]][["yielded", 1], ["raised", "KeyError"], ["StopIteration", null]]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 ↗