code wiki / (root) / _offc_deref_minimal_v2.nx

_offc_deref_minimal_v2.nx source

↩ module page · 11 lines · 273 B

1// Even simpler: no array, no struct, just one *p = N then return *p. 2// Use a local stack variable as the pointer source (not mmap, not call). 3 4import "syscalls.nx" 5 6func main() -> i64 { 7 var slot: i64 = 0 8 let p: *i64 = &slot 9 *p = 42 10 return *p 11}