mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-09 09:11:00 +08:00
The 8 channel-extraction DFS walkers (Python consts, Python, Go, Java, C#, Ruby, Elixir, Rust) used fixed-size `TSNode stack[CHAN_STACK_CAP]` arrays whose push loops guarded with `&& top < CHAN_STACK_CAP`. On deeply-nested ASTs that guard silently dropped children, and an unguarded overflow could corrupt adjacent stack memory — surfacing as a segfault in a later pass (lsp_cross / semantic_edges) on large repos. Convert all 8 to the arena-backed growable TSNodeStack (ts_nstack_init/push/pop), matching the pattern already used in extract_calls.c / extract_imports.c (PR #217). No silent drops, no overflow. Distilled from #339 (trailing-newline cleanup only; conversion is the author's).