mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-10-28 07:03:20 +08:00
Root cause: c_eval_expr_type_inner has 42 places accessing ptr->kind on CBMType* pointers. Some code paths (cbm_type_substitute, internal lookups) return NULL on unusual C++ AST shapes (deeply nested templates, 300+ defs per file). NULL->kind = SIGSEGV. Fix: safe_kind() inline returns CBM_TYPE_UNKNOWN for NULL pointers. All 42 ->kind accesses in c_eval_expr_type_inner replaced. Also: recursion depth guard (256), cbm_type_substitute returns cbm_type_unknown() for NULL input, walk_usages/walk_env depth limits. Verified: spdlog (previously crashed) now indexes 2526 nodes, 5518 edges. All 2586 tests pass.