Skip to content

Commit e3f7395

Browse files
committed
Bugfix: don't try to access data from line which does not exist,
'interesting region' select filter sort order. Signed-off-by: Henry Cox <[email protected]>
1 parent d4a127e commit e3f7395

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bin/genhtml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,10 @@ sub removeLine
10331033
my ($self, $lineData) = @_;
10341034

10351035
my $l = $self->[LINE_DATA]->[DATA];
1036-
$l->{hit} -= $lineData->curr_count() != 0;
1037-
$l->{found} -= 1 if $lineData->in_curr();
1036+
if ($lineData->in_curr()) {
1037+
$l->{hit} -= $lineData->curr_count() != 0;
1038+
$l->{found} -= 1;
1039+
}
10381040
if ($lcovutil::br_coverage) {
10391041
my $b = $lineData->current_branch();
10401042
if (defined($b)) {
@@ -3794,7 +3796,7 @@ sub new
37943796
push(@lineArray, $line);
37953797
}
37963798
}
3797-
@lineArray = sort(@lineArray);
3799+
@lineArray = sort({ $a <=> $b } @lineArray);
37983800
$self->[INTERESTING_LINES] = \@lineArray;
37993801
$inRegion = InInterestingRegion->new(@lineArray);
38003802
}

0 commit comments

Comments
 (0)