code wiki / (root) / _derefcast_minrepro.nx

_derefcast_minrepro.nx

buildroot/runtime/_derefcast_minrepro.nx

1563 B47 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

_derefcast_minrepro.nx -- min repro: deref + pointer-cast in ONE expression (`*p as *u8`) miscompiles on the native x86 lane. Found 2026-06-10 building nx_tls13_ch_compat_test (B2 row): a pointer value stored through an out-param read back via let host: *u8 = *host_p as *u8 then dereferenced -> SIGSEGV. Flattening into let hv: i64 = host_p[0] let host: *u8 = hv as *u8 compiles correctly. Same family as the 4-deep nested-if and >6-arg tail-call landmines: expression-shape miscompile. exit 0 = BOTH shapes work (defect fixed -- browser-gate row). exit 1/2 = a shape produced a wrong value; SIGSEGV = the original defect (pre-fix compilers byte-load the cell and deref garbage). FIXED 2026-06-10: parse_unary wrapper owns the trailing `as` so prefix `*` binds tighter than `as` (see nx_parse.nx). This row guards the lane against precedence regressions, like _arg7_minrepro guards the >6-arg tail-call drop. expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _derefcast_minrepro.nx

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

main sys_mmap

structs

none

consts

none

functions

27func main() -> i64
calls 1: sys_mmap