Skip to main content

Phase 7. Error model

FieldValue
MEPMEP-45 §Phases · Phase 7
StatusNOT STARTED
Started
Landed
Tracking issue
Tracking PR

Gate

Error-model fixture suite (~30 cases: panic, try { ... } catch e { ... }, deferred cleanup, finally, nested try, panic across closure boundary) compiles + runs byte-equal vs vm3 on host triple.

Goal-alignment audit

To be written before sub-phase 7.0 starts. Error handling is core surface; without it long-running programs cannot recover from expected failures. Aligns.

Sub-phases

#ScopeStatusCommitPR
7.0Per-thread exception jump-buffer stack (TLS); mochi_try_push / mochi_try_pop / mochi_raise(int, mochi_str)NOT STARTED
7.1try { ... } catch e { ... } lowers to if (setjmp(buf) == 0) { ... } else { ... } with cleanup on longjmp pathNOT STARTED
7.2Built-in error codes (MOCHI_ERR_*) wired through runtime calls (divzero, OOB, type mismatch, parse)NOT STARTED
7.3User error codes (positive integers); user panic(code, msg) lowers to mochi_raiseNOT STARTED

Decisions made

Fill in along the way.

Deferred work

Itanium-style table-driven unwind via libunwind: v2.

Closeout notes

Fill in after gate green.