Skip to content

Commit bb59844

Browse files
committed
Bugfix: incorrect 'end line' calculation when deleted function found and end of file. See #408.
Signed-off-by: Henry Cox <[email protected]>
1 parent df03ba4 commit bb59844

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

bin/genhtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5646,6 +5646,9 @@ sub _synthesize
56465646
if ($lcovutil::func_coverage) {
56475647
while (my ($fnName, $funcEntry) = each(%{$fileCovInfo->functionMap()}))
56485648
{
5649+
my $tla = $funcEntry->hit()->[1];
5650+
# deleted function doesn't count
5651+
next if grep(/^$tla$/, ('DUB', 'DCB'));
56495652
my $line = $funcEntry->line();
56505653
my $end = $funcEntry->end_line();
56515654
$last_line = $line if $line > $last_line;

example/methods/iterate.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
#include <limits.h>
1717
#include "iterate.h"
1818

19+
void test_data_logging(int, int);
1920

2021
int iterate_get_sum (int min, int max)
2122
{
2223
int i, total;
2324

25+
test_data_logging(min, max);
26+
2427
total = 0;
2528

2629
/* This is where we loop over each number in the range, including
@@ -44,3 +47,11 @@ int iterate_get_sum (int min, int max)
4447

4548
return total;
4649
}
50+
51+
void
52+
test_data_logging(int min, int max)
53+
{
54+
(void)min; /* quiet compiler complaints */
55+
(void)max;
56+
printf("this is some debug data logging code that gets removed in the final product\n");
57+
}

0 commit comments

Comments
 (0)