Skip to content

C struct callback invocations bind to unrelated same-named free functions #5410

Open

Description

@sdivyanshu90

C extraction can record a call through a struct function pointer as an EXTRACTED call to a free function with the same name. The member name provides no evidence for that target.

Reproduction

With Graphify 0.9.115 and Python 3.14, create a.c containing:

struct Ops { void (*run)(void); };
void run(void) {}
void invoke(struct Ops *ops) { ops->run(); }
void direct(void) { run(); }

Run graphify extract . --code-only on a fresh corpus. Both invoke and direct point to the free function run. Only direct names that function. The runtime target of ops->run() is unknown from the selector alone.

Keep field callees out of C's generic bare-name call lookup. Cover both pointer and value selectors and verify that direct calls still resolve.

Activity

  1. github-actions commented on Nov 23, 2026

    @github-actions

    Thanks for opening this issue, @sdivyanshu90. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions