nx_rw_args3.nx source
↩ module page · 20 lines · 674 B
1// nx_rw_args3.nx -- TRAP WITNESS (pack-rules vet). Tactic under test: a helper with the exact
2// documented 3-data-arg crash mix (ptr, ptr, i64) called via `let r = ...` (2026-07-10 GC-gate
3// shape: callee not even entered). Exit 0 iff the call passes all three args correctly.
4// license_tier: ORIGINAL
5import "nx_syscalls.nx"
6
7func rw_chk(label: *u8, src: *u8, want: i64) -> i64 {
8 let a: i64 = label[0] as i64
9 let b: i64 = src[0] as i64
10 let s: i64 = a + b
11 if s == want { return 1 }
12 return 0
13}
14
15func main(argc: i64, argv: *i64) -> i64 {
16 let r: i64 = rw_chk("A" as *u8, "B" as *u8, 131)
17 if r == 1 { sys_exit(0) }
18 sys_exit(1)
19 return 0
20}