From 515b93e9e7d80f2ccf3e53b1e07bc28c8e128124 Mon Sep 17 00:00:00 2001 From: VintagePC <53943260+vintagepc@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:39:03 -0400 Subject: [PATCH] Patch gcovr script - take 3 --- utils/gcovr.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/gcovr.py b/utils/gcovr.py index 4bc7ba9..725b0f1 100755 --- a/utils/gcovr.py +++ b/utils/gcovr.py @@ -619,6 +619,10 @@ def process_gcov_data(data_fname, covdata, source_fname, options): is_code_statement = False if tmp[0] == '-' or (excluding and tmp[0] in "#=0123456789"): is_code_statement = True + if len(segments) < 3: + noncode.add(lineno) + continue + code = segments[2].strip() # remember certain non-executed lines if excluding or is_non_code(segments[2]): @@ -632,11 +636,9 @@ def process_gcov_data(data_fname, covdata, source_fname, options): elif tmp[0] == '=': is_code_statement = True uncovered_exceptional.add(lineno) - elif tmp[0] in "0123456789" and segments[0].endswith("*"): - continue elif tmp[0] in "0123456789": is_code_statement = True - covered[lineno] = int(segments[0].strip()) + covered[lineno] = int(segments[0].strip().rstrip('*')) elif tmp.startswith('branch'): exclude_branch = False if options.exclude_unreachable_branches and \