_offc_deref_store_minimal.nx source
↩ module page · 11 lines · 238 B
1// Smallest possible deref-store test.
2// Returns 42 iff `*p = N` AND `*p` (read) both work.
3
4import "syscalls.nx"
5
6func main() -> i64 {
7 let raw: *u8 = sys_mmap(64)
8 let p: *i64 = raw as *i64
9 *p = 42
10 return *p
11}