Files
codegraph/__tests__
Josh66andClaude Opus 5.5 0d7480f83b fix(cpp): an overload chosen by arguments that call it again no longer overflows the stack
On main, indexing darts-clone failed in "Resolving refs" with "Maximum call
stack size exceeded", and the whole run was lost. darts.h writes
`extras(extras(id).prev()).set_next(extras(id).next())` on a class with a
const and a non-const `extras(id)`. Choosing between them types the
arguments; typing `extras(id).prev()` types `extras(id)`, whose overload is
chosen by the arguments of the call the reference is at, the outer one, so
the same arguments are typed again. cppArgumentType restarts
cppExpressionType's depth at 0 on each lap, so the depth bound never trips.

cppArgumentTypeChoice now keeps the calls whose arguments it is typing
(`file:line:column:name`), and a choice that comes back to the same call
takes the first tied overload, the answer it already gives when no
argument's type is known. A try/finally clears the entry.

Validation on main 5526e33d (Windows 11):
- Red/green: the new test fails with main's name-matcher.ts (RangeError:
  Maximum call stack size exceeded) and passes with the fix.
- A/B against main: darts-clone fails on main and indexes with the fix,
  503 more linked sites (897 edges against the 394 the failed run left),
  with `reserve_id` and `expand_units` reaching `extras`, `prev`, `next`,
  `set_prev` and `set_next`. leveldb, fmt, googletest and nlohmann/json are
  byte-identical, as are the express and flask controls.
- Index time unchanged: median of 3 interleaved runs on nlohmann/json,
  15.9 s on main and 16.0 s with the fix.

Original PR #2999 by @JosefAschauer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:41:11 +00:00
..