nx_option_enforce_ok.nx
buildroot/runtime/nx_option_enforce_ok.nx
about
nx_option_enforce_ok.nx -- LN2 POSITIVE CONTROL: every narrowing idiom the mode recognises, in one
program that must compile under `--optenforce` AND run to exit 0 under both modes. A deny mode
that refuses everything fails HERE, and a mode that missed one idiom would refuse real code.
I1 `if p == 0 { return }` early exit -> p non-null for the rest of the block
I2 `if p != 0 { ... }` -> non-null inside the then-block
I3 `if (p as i64) == 0 { return }` -> the cast-shaped early exit
I4 `while q != (0 as *OkNode) { ... }` -> non-null inside the body
I5 `if p == 0 { } else { ... }` -> non-null inside the else-block
I6 nx_assert_ptr(p as *u8, "...") -> non-null for the rest of the block
I7 `let s = &local` -> bound non-null, no guard needed
I8 a `var` pointer re-checked after reassignment
I9 the write legs: `p.f = v`, `*p = v` after a guard
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_assert.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 17 | struct OkNode |
consts
| none |
functions
| 22 | func ok_make(v: i64, nxt: *OkNode) -> *OkNode |
| 28 | func ok_maybe(k: i64) -> *OkNode called by 7: i1_early_exiti2_then_blocki3_cast_exiti5_else_blocki6_asserti8_var_recheck+1 calls 1: ok_make |
| 33 | func i1_early_exit(k: i64) -> i64 |
| 38 | func i2_then_block(k: i64) -> i64 |
| 44 | func i3_cast_exit(k: i64) -> i64 |
| 49 | func i4_while_walk(k: i64) -> i64 |
| 59 | func i5_else_block(k: i64) -> i64 |
| 65 | func i6_assert(k: i64) -> i64 |
| 70 | func i7_addr_of() -> i64 called by 1: main |
| 75 | func i8_var_recheck(k: i64) -> i64 |
| 83 | func i9_writes(k: i64) -> i64 |
| 93 | func main(argc: i64, argv: *i64) -> i64 |