From 664f3bf36007b3525150a59a9b806c605be38616 Mon Sep 17 00:00:00 2001 From: navidem Date: Fri, 11 Feb 2022 18:41:22 +0000 Subject: [PATCH] Fix keyError for reached functions in two other cases --- post-processing/fuzz_data_loader.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/post-processing/fuzz_data_loader.py b/post-processing/fuzz_data_loader.py index b51d64c21..7f3fa62a7 100644 --- a/post-processing/fuzz_data_loader.py +++ b/post-processing/fuzz_data_loader.py @@ -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 @@ -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: