Skip to content

Commit

Permalink
Analyser: Fix unexpected exit from coverage extraction
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Chan <[email protected]>
  • Loading branch information
arthurscchan committed Jan 21, 2025
1 parent df99d98 commit 8e5c324
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/fuzz_introspector/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ def get_node_coverage_hitcount(demangled_name: str, callstack: Dict[int, str],
# The difference is this node has node "parent" or prior nodes.

if not profile.func_is_entrypoint(demangled_name):
raise AnalysisError(
logger.warning(
"First node in calltree is non-fuzzer function")
return 0
if profile.coverage.get_type() == 'kernel':
# For now, assume EP is hit. TODO(David) adjust this.
return 100
Expand Down
7 changes: 6 additions & 1 deletion src/fuzz_introspector/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,13 @@ def analyse(args) -> int:
entrypoint=entrypoint,
out=out_dir)

if 'c' in args.language:
language = 'c-cpp'
else:
language = args.language

# Perform the FI backend project analysis from the frontend
introspection_proj = analysis.IntrospectionProject(args.language, out_dir,
introspection_proj = analysis.IntrospectionProject(language, out_dir,
'')
introspection_proj.load_data_files(True, '', out_dir)

Expand Down

0 comments on commit 8e5c324

Please sign in to comment.