Skip to content

[DESIGN] Call graph (C): resolve or represent indirect calls through function pointers and dispatch tables (follow-on to #8956) #9042

Open

Description

@squid-protocol

Follow-on design issue per #8956 Acceptance #4.

Confirmed baseline (#8956, PR #9039)

Hand-checked sample on curl (01798a0):

  • 20/20 sampled dispatch call sites (10 cft->, 10 ->run->) landed in fcall_external (0 linked, 0 wrong).
  • 0/10 sampled dispatch-table initializers (6 Curl_cftype, 4 Curl_protocol) emitted edges to their implementations (33/36 sampled implementations had func_fan_in = 0).

Design questions to settle before implementation

  1. Table initializers as C reference edges: Should static/global struct initializers referencing repo function symbols emit reference edges (analogous to Python's reference_edges), and what is the measured precision on C repos (hiredis, libuv, curl)?
  2. Member-call to table-field linking: Whether a dispatch call x->field(...) can/should be linked via struct-type field bindings or kept as a separate candidate/ambiguous kind.
  3. Wrong-link regression guard ([BUG] Call graph (C): indirect calls through function pointers and dispatch tables are not linked to their implementations (unverified hypothesis) #8956 Acceptance pypi fix #5): Ensure a local/parameter function pointer fp(x) whose name happens to collide with an unrelated repo function does not emit a false confident link.
  4. Gate & golden impact: Any new C edge kind changes the graph and requires a scoped golden re-bless and explicit measurement (since libclang skips function-pointer calls).

Activity

  1. added
    enhancement
    core-engine
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    call-graphcore-engineenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions