code wiki / _hdl_build / nx_cap_detect_lib.nx
nx_cap_detect_lib.nx
buildroot/runtime/_hdl_build/nx_cap_detect_lib.nx
about
nx_cap_detect_lib.nx -- the SILENT-TRUNCATION CAP detector CORE, shared (DRY, rule 15) by the CLI sweep
(nx_janitor_caps) and the gate (nx_janitor_caps_gate). Pure text analysis over a .nx source buffer; no
syscalls, no I/O -- the caller supplies the bytes. The detector flags the exact bug class that caused the
seg-store "stored-not-served" outage: a fixed-count array whose literal count ALSO bounds a fill loop, in a
file that reads an unbounded source. See nx_janitor_caps.nx for the full rationale.
license_tier: ORIGINAL | genealogy_id: nishi_cap_detect_lib_2026_07_15
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_janitor_caps.nxnx_janitor_caps_gate.nx
structs
| none |
consts
| 10 | const JC_MIN_COUNT: i64 = 32 |
functions
| 13 | func jc_match_at(buf: *u8, pos: i64, pat: *u8, plen: i64) -> i64 |
| 17 | func jc_find_sub(buf: *u8, n: i64, pat: *u8, plen: i64) -> i64 |
| 22 | func jc_has_src(buf: *u8, n: i64) -> i64 |
| 32 | func jc_lit_after(buf: *u8, n: i64, pos: i64, N: i64) -> i64 called by 1: jc_has_bound |
| 48 | func jc_has_bound(buf: *u8, n: i64, N: i64) -> i64 |
| 70 | func jc_strip_noncode(src: *u8, n: i64, dst: *u8) -> i64 called by 1: jc_walk |
| 106 | func jc_mmap_scan(buf: *u8, n: i64) -> i64 |