Skip to content

feat: call graph and function summaries - #28

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/callgraph
Sep 3, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/callgraph

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

Opens Phase 6 of docs/architecture.md with §20 Call Graph and §19 Function Summaries.

  • Acceptance tests first (test: define call graph and function summary behavior), implementation follows.
  • interprocedural/callgraph.py: CallGraphAnalysis (interprocedural.callgraph) resolves every call site of every analysable function through the SSA form to a KnownFunction defined at module level, an ExternalSymbol reached through imports or builtins, or UnknownTarget. Local aliases and later definitions resolve; shadowed names do not. Functions outside the lowering subset are listed as unsupported instead of failing the graph.
  • interprocedural/summaries.py: SummaryAnalysis (interprocedural.summaries) computes a FunctionSummary per function: which parameters the return value depends on, and which external symbols the parameters reach, directly or through calls to other known functions (each ExternalCall keeps the sink location and the call site it went through). Computed as a dependence data-flow problem over the SSA form, iterated to a fixpoint over the call graph so recursion converges to the least solution. Unsupported functions get a conservative summary.
  • Summaries carry no security knowledge; the next item makes the taint engine consume them so Runner().go(input()) style flows cross function boundaries.
  • qualified_name is shared by lowering and the call graph (Class.method for methods).

Not in this PR: ModuleGraph and cross-file analysis, method and attribute targets (need type inference and framework models), heap and aliasing.

Part of #27

@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 3, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit dd1e0db into main Sep 3, 2026
6 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/callgraph branch September 3, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant