Skip to content

Commit

Permalink
frontends: datatypes: add new xref function (#2099)
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <david@adalogics.com>
  • Loading branch information
DavidKorczynski authored Feb 15, 2025
1 parent 4af7407 commit e07cd6d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/fuzz_introspector/frontends/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ def get_cross_references(self, src_func: Any) -> list[Any]:

return xrefs

def get_cross_references_by_name(self, function_name) -> list[Any]:
"""Get cross reference functions by a target function name."""
xrefs = []
for func in self.all_functions:
for callsite in func.base_callsites:
if callsite[0] == function_name:
xrefs.append(func)
return xrefs

def find_function_by_name(self, target_function_name, only_exact_match):
"""Helper function to find the matching function."""
for function in self.all_functions:
Expand Down

0 comments on commit e07cd6d

Please sign in to comment.