code wiki / (root) / nx_probe_ptrfield_idx.nx

nx_probe_ptrfield_idx.nx

buildroot/runtime/nx_probe_ptrfield_idx.nx

5282 B104 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind probetopic probe
docsdependenciesstructsconstsfunctions

about

nx_probe_ptrfield_idx.nx -- MINIMAL REPRO for debt 1786057660. CLAIM UNDER TEST: nx_cc miscompiles `structptr.field[i]` when `field` is a pointer to a NON-BYTE type. Isolated by differential bisect in nx_linemap.nx (three *i64 fields); this probe strips that finding to the smallest shape that can still exhibit it, so the verdict is about the LANGUAGE FEATURE and not about the line map. The estate's existing instance of the pattern is ctx.out[pos] in nx_import.nx, where the field is *u8 -- element size 1, so an element-size scaling error is invisible BY CONSTRUCTION. Every other *i64 indexing site nearby (canonicalise_path) uses a LOCAL handle. So the codebase avoided this shape by accident, not by design, and nothing tests it. Exit codes name the exact failing direction rather than a single boolean: 0 = no defect: field-index and hoisted-local addressing agree, both directions 11 = write-via-field / read-via-local disagreed at index 0 (base or scale wrong) 12 = ... at index 1 (index 0 agreeing but 1 not => SCALE, not base) 13 = ... at index 2 14 = write-via-local / read-via-field disagreed (the reverse direction) 15 = *u8 control FAILED -- if this fires the defect is broader than non-byte pointers and the whole diagnosis in 1786057660 needs rewriting

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_probe_ptrfield_idx.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ pf_say sys_write ↻

structs

31struct PfHolder

consts

23const K_MAGIC_1111: i64 = 1111
24const K_MAGIC_2222: i64 = 2222
25const K_MAGIC_3333: i64 = 3333
26const K_MAGIC_4444: i64 = 4444
27const K_MAGIC_5555: i64 = 5555
28const K_MAGIC_6666: i64 = 6666
29const K_MAGIC_23331: i64 = 23331

functions

39func pf_say(s: *u8) -> i64
called by 1: main calls 1: sys_write
46func main() -> i64
calls 2: sys_mmappf_say