Skip to content

Commit 94eac0e

Browse files
committed
lcov: Fix branch coverage summary
When combining two data files A (without branch coverage data) and B (with branch coverage data), lcov will incorrectly report no branch coverage data for the resulting file in program output, even though the resulting file contains branch coverage data. This only happens when A is specified first during the add operation. This is due to a bug in lcov that loses the correctly combined branch coverage data internally in function brcount_db_combine() when its first parameter is undefined. Fix this by ensuring that the first parameter is an empty hash reference instead. Signed-off-by: Peter Oberparleiter <[email protected]>
1 parent a5dd952 commit 94eac0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/lcov

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,7 @@ sub brcount_to_db($)
21532153
{
21542154
my ($brcount) = @_;
21552155
my $line;
2156-
my $db;
2156+
my $db = {};
21572157

21582158
# Add branches to database
21592159
foreach $line (keys(%{$brcount})) {

0 commit comments

Comments
 (0)