code wiki / (root) / nx_smoke_str_arg.nx

nx_smoke_str_arg.nx source

↩ module page · 19 lines · 546 B

1// smoke_str_arg.nx -- pass a string literal to a function, read first byte. 2 3// nx_safety_envelope: 4// intended_use: AUTO_APPLIED -- primitive-specific tuning queued 5// sil_target: SIL1 6// evidence: [bulk_applied_2026-05-16, see-file-comment-for-detail] 7// verdict: NOT_YET_EVALUATED 8 9import "nx_syscalls.nx" 10 11func first_byte(s: *u8) -> i64 { 12 return s[0] 13} 14 15func main() -> i64 { 16 let v: i64 = first_byte("Z") 17 // 'Z' = 0x5A = 90. Should exit 90. 18 return __syscall(93, v, 0, 0, 0, 0, 0) 19}