v0.20.1 — fix indirect call detection for array subscript expressions
Overview
Patch release fixing find_indirect_call_sites for array-subscript
function pointer calls — the primary dispatch pattern in embedded
firmware (ISR vector tables, callback arrays, state machine dispatch).
Also surfaces indirect call sites in get_symbol_context for function
and method symbols.
Changes
Fixes
- Array subscript indirect call detection —
handlers[irq](arg),
obj->callbacks[idx](args), and similar patterns are now detected as
indirect call sites. Previouslycursor.referencedwas None for
ArraySubscriptExprcallees, so the call site was silently missed. - get_symbol_context for functions —
indirect_call_sitesfield is
now populated forfunctionandmethodsymbols (viafrom_usr
query), not only forfieldandvariablesymbols.
| File | Change |
|---|---|
src/fw_context_mcp/indexer/symbols.py |
_first_child_unwrapped helper + ArraySubscriptExpr fallback in indirect call site extraction |
src/fw_context_mcp/mcp/handlers/source.py |
from_usr query for function/method indirect call sites in get_symbol_context |
tests/test_db.py |
4 tests: array subscript, struct array member, no false positives, member access regression |
Breaking changes
None.