code wiki / _hdl_build / nx_probe_ptrarg_live.nx

nx_probe_ptrarg_live.nx source

↩ module page · 15 lines · 889 B

1// nx_probe_ptrarg_live.nx -- LIVE WITNESS for pointer-vs-scalar param type checking (2026-08-05). 2// This BUILDS -- and that is BY DESIGN, not a gap: integer LITERALS are exempt from the 3// 2026-08-01 call-arg type check because the corpus uses literals as null/sentinel pointers 4// (nx_parse.nx VK_CONST_INT exemption; only a TYPED value carries a real claim about pointerness). 5// The ENFORCED direction has its own witness: nx_probe_ptrint_live.nx (pointer-into-integer REFUSED). 6// The reverse TYPED direction (i64 var into *u8) is DELIBERATELY DISABLED pending the sys_munmap 7// arg-1 residue (57/70 corpus rejects, unexplained -- see nx_parse.nx flip-line comment). 8// license_tier: ORIGINAL expect_exit: 0 9import "nx_syscalls.nx" 10func pt_ptr(p: *u8) -> i64 { return p[0] as i64 } 11func main(argc: i64, argv: *i64) -> i64 { 12 let x: i64 = pt_ptr(5) 13 sys_exit(0) 14 return 0 15}