Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/fuzz_introspector/datatypes/project_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def __init__(self, profiles: List[fuzzer_profile.FuzzerProfile],
# Add all functions from the various profiles into the merged profile. Don't
# add duplicates
logger.info("Creating all_functions dictionary")
excluded_functions = {"sanitizer", "llvm", "LLVMFuzzerTestOneInput"}
excluded_functions_tuple = ("sanitizer", "llvm",
"LLVMFuzzerTestOneInput")
for profile in profiles:
# Handles jvm constructors
for fd in profile.all_class_constructors.values():
Expand All @@ -158,9 +159,14 @@ def __init__(self, profiles: List[fuzzer_profile.FuzzerProfile],

# Handles normal functions
for fd in profile.all_class_functions.values():
# Performance Optimization: Avoid any() with generator for O(N) substring checks.
# continue if the function is to be excluded
if any(to_exclude in fd.function_name
for to_exclude in excluded_functions):
to_exclude = False
for ex in excluded_functions_tuple:
if ex in fd.function_name:
to_exclude = True
break
if to_exclude:
continue

current_fd = self.all_functions.get(fd.function_name)
Expand Down
Loading