trap
Fil-C also trap reason, Fil-C panic, safety error
Upstream InvisiCaps by example, filc_runtime.h
A trap is a Fil-C check failing, which upstream calls a Fil-C panic or safety error (filc_safety_panic): the run ends trapReason, terminal and uncatchable. Because nothing follows it, a check is a pure assertion, which is why a check proved never to fail can be deleted without changing behaviour.
The reasons:
null_capability,out_of_bounds,misaligned,readonly,not_a_function,argument_size,return_size,invalid_free,double_free,too_big,out_of_memory, andearlyWhyfor a check_ahead whose failure came early. The access check tests null, then bounds, then read-only, then alignment (cap_access_res).Memory.v's
reasonis shared with unchecked, which addsalias,span,half,limitandaheadWhy: the reuse forms' broken trusts, never traps.resis a partial result: a value,RTraporRUnchecked.interp.pl's reasons are coarse: past the end, below the start, freed and a function object all trap
out_of_bounds. The exact native text is compared by progtest and tests/renew-trap.sh.
The subtlety: Campaign 7 does not count every trap as a panic. It counts too_big and out_of_memory as resource endings (formal.md, What counts as a panic).
Linked from
- ExternalCalls.v: call_end
- ExternalCalls.v: resource_reason
- ExternalMachine.v: violation
- FUGC
- GIMSO
- How Fil-C works: The promise
- Memory.v: kind
- NFB guide (Wonderful): 6. What Fil-C guarantees, in one page
- Panics.v: refusal
- Runtime.v: free_checked
- Runtime.v: free_res_checked
- Runtime.v: traps_as_freed
- Semantics.v: bind_res
- Semantics.v: conv
- Semantics.v: doomed_result
- Semantics.v: outcome
- Syntax.v: ahead_transparent
- Transport.v: ereason
- check
- fast and generic conventions
- mode
- origin
- outcome
- unchecked