code wiki / (root) / _offc_gap3_repro_v2.nx

_offc_gap3_repro_v2.nx source

↩ module page · 27 lines · 764 B

1// nx_safety_envelope: 2// intended_use: AUTO_APPLIED -- primitive-specific tuning queued 3// sil_target: SIL1 4// evidence: [bulk_applied_2026-05-16, see-file-comment-for-detail] 5// verdict: NOT_YET_EVALUATED 6 7import "nx_syscalls.nx" 8import "nx_runtime.nx" 9import "nx_tier.nx" 10 11struct Verdict { kind: nx_int, score: nx_int } 12 13func compute() -> *Verdict { 14 let v: *Verdict = (sys_mmap(16)) as *Verdict 15 v.kind = 7 16 v.score = 42 17 return v 18} 19 20func main() -> nx_exit { 21 let v: *Verdict = compute() 22 // The reportedly-bugged pattern: compare struct field directly 23 // after call-returning-pointer. Gap 3 says this SEGFAULTs. 24 if v.kind != 7 { return 1 } 25 if v.score != 42 { return 2 } 26 return 0 27}