code wiki / _hdl_build / nx_doc_ubscan.nx

nx_doc_ubscan.nx

buildroot/runtime/_hdl_build/nx_doc_ubscan.nx

2616 B45 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic doc
docsdependenciesstructsconstsfunctions

about

nx_doc_ubscan.nx -- a static detector for the UNDEFINED-BEHAVIOR pattern LM-031: an inline cast-then-index `(EXPR as *T)[i]` SILENTLY MISCOMPILES in NishiLang, returning a garbage pointer-sized value with NO error (it cost a real bug: nx_vizsla_notes nv_occ_window returned a bogus deadline year; nx_doc_demo_const ran exit 156 for expected 99). The fix-by-construction (LM-031): bind the cast to a local FIRST, then index. This detector flags the dangerous inline form so it's caught BEFORE it corrupts data -- the build-resolve loop can't (it's a silent miscompile, no build failure). LINEAGE: this is the NISHI RECYCLER's CONVERT of the undefined-behavior critique (knowledge/fetched/recyc_crit_ub.raw) that nx_recycler_extract flagged as APPLIES-to-us -> turned into real hardening. READ-ONLY (no rewrite). Doctor-family sibling of nx_doc_kwscan / nx_doc_mainscan. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_doc_heal_let.nx nx_doc_ubscan.nx nx_doc_ubscan_gate.nx

imports: nx_syscalls.nxnx_doc_heal_let.nx

imported by: nx_doc_ubscan_gate.nx

structs

none

consts

none

functions

12func ub_skipws(src: *u8, n: i64, p0: i64) -> i64
called by 1: ub_castindex_at
18func ub_castindex_at(src: *u8, n: i64, i: i64) -> i64
called by 1: ub_scan calls 2: dhl_isidentub_skipws
41func ub_scan(src: *u8, n: i64) -> i64
called by 1: main calls 1: ub_castindex_at