code wiki / _hdl_build / nx_arg7_repro.nx
nx_arg7_repro.nx
buildroot/runtime/_hdl_build/nx_arg7_repro.nx
about
nx_arg7_repro.nx -- minimal repro of the >6-param segfault. p7 takes 7 pointer params and WRITES THROUGH the
7th (g) LATE, after using the first six -- mirroring expand_one's selbox[0]=sel. If the toolchain mishandles
param idx 6 (the stack arg), g[0]=99 dereferences garbage -> SIGSEGV. expect: g[0]==99, sum prints, exit 0.
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
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
structs
| none |
consts
| none |
functions
| 7 | func pw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 8 | func pn(v: i64) -> i64 { if v==0 { sys_write(1,"0" as *u8,1); return 0 } var m: i64=v; if m<0 { sys_write(1,"-" as *u8,1); m=0-m } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } let o: *u8=sys_mmap(24); var w: i64=0; var q: i64=k-1; while q>=0 { o[w]=t[q]; w=w+1; q=q-1 } sys_write(1,o,w); return 0 } |
| 10 | func clobber(x: i64) -> i64 { var s: i64=0; var i: i64=0; while i<x { s=s+i; i=i+1 } return s } called by 1: p7 |
| 12 | func p8(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64, h: i64) -> i64 { return a+b+c+d+e+f+g+h } called by 1: p7 |
| 14 | func p7(a: *i64, b: *i64, c: *i64, d: *i64, e: *i64, f: *i64, g: *i64) -> i64 |
| 22 | func main() -> i64 |