Skip to content

Function pointer multiple dispatch #24

@hudson-ayers

Description

@hudson-ayers

Hi, I am curious if you have any thoughts on what it would take to support function pointers which could resolve to multiple target functions. This line seems to be the relevant location where Haybale currently gives up if a function pointer can resolve to multiple functions. Would it be possible for other (still small) values of n to treat function pointer calls as effectively branching points, with each possibly destination representing an additional path? Presumably there are reasons this is difficult and as such not supported currently.

I am mostly curious because I have been maintaining a fork of Haybale which uses custom, Rust specific logic to handle Rust dynamic dispatch by identifying possible targets of dynamic dispatch by parsing LLVM-IR debug info + Rust's MIR to find valid concrete functions at dynamic dispatch points. If Haybale had general support for function pointers with multiple targets, I could simplify this implementation such that it could maybe just be a user-defined hook rather than a direct modification of Haybale itself.

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