Skip to content

Commit

Permalink
Fix keyError for reached functions in two other cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Navidem committed Feb 11, 2022
1 parent ee9f3ad commit 664f3bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions post-processing/fuzz_data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ def add_func_to_reached_and_clone(merged_profile_old: MergedProjectProfile,

# Update hitcount of all functions reached by the function
for func_name in func_to_add.functions_reached:
if func_name not in merged_profile.all_functions:
l.error("Found mismatched function name between merged all_functions and functions_reached: %s"%(func_name))
continue
f = merged_profile.all_functions[func_name]
if f.hitcount == 0:
f.hitcount = 1
Expand All @@ -407,6 +410,9 @@ def add_func_to_reached_and_clone(merged_profile_old: MergedProjectProfile,
cc = 0
uncovered_cc = 0
for reached_func_name in f_profile.functions_reached:
if reached_func_name not in merged_profile.all_functions:
l.error("Found mismatched function name between merged all_functions and functions_reached: %s"%(reached_func_name))
continue
f_reached = merged_profile.all_functions[reached_func_name]
cc += f_reached.cyclomatic_complexity
if f_reached.hitcount == 0:
Expand Down

0 comments on commit 664f3bf

Please sign in to comment.