code wiki / (root) / nx_addrof_test.nx

nx_addrof_test.nx

buildroot/runtime/nx_addrof_test.nx

1950 B53 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_addrof_test.nx -- PREVENT/MONITOR pillar for the address-of-local codegen bug class (T#native-addrof). BUG (found 2026-05-28): bare `&x` on an alloca-backed local returned the raw alloca value-id, which the codegen AUTO-LOADS (movq slot) -> the slot CONTENTS were passed as a pointer -> SEGV. Latent in nx_jose's `&off` (never run under the native compiler). FIX: parser emits OP_ADDR_OF -> codegen uses the AS-ADDRESS (leaq) path. THIS test is the regression guard: any reintroduction of the auto-load behavior fails it loudly. Run under the native compiler in the daily smoke.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_addrof_test.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 ao_bump sys_write ao_set_ptr sys_mmap sys_mmap ↻

structs

16struct AoPair { a: i64, b: i64 }

consts

none

functions

18func ao_bump(p: *i64) -> i64 { p[0] = p[0] + 41; return 0 }
called by 1: main
21func ao_set_ptr(out: *i64, val: i64) -> i64
called by 1: main calls 1: sys_mmap
28func main() -> i64