code wiki / (root) / nx_rw_emptystr.nx

nx_rw_emptystr.nx source

↩ module page · 18 lines · 637 B

1// nx_rw_emptystr.nx -- DELIBERATE TRAP WITNESS (pack-rules vet). Tactic under test: the bare "" 2// empty-string literal (documented 2026-07-09: ("" as *u8)[0] != 0 -- aliases the next literal). 3// Exit 0 iff "" yields a real NUL-first byte AND the neighbor literal is intact. While ACTIVE 4// this is EXPECTED to exit nonzero. Not a defect. 5// license_tier: ORIGINAL 6import "nx_syscalls.nx" 7 8func main(argc: i64, argv: *i64) -> i64 { 9 let e: *u8 = "" as *u8 10 let x: *u8 = "XYZ" as *u8 11 let c: i64 = e[0] as i64 12 let k: i64 = x[0] as i64 13 if c == 0 { 14 if k == 88 { sys_exit(0) } 15 } 16 sys_exit(1) 17 return 0 18}