@@ -5600,18 +5600,26 @@ sub parseLines
5600
5600
my @excludes ;
5601
5601
if (defined ($lcovutil::cov_filter [$lcovutil::FILTER_EXCLUDE_REGION ])) {
5602
5602
push (@excludes ,
5603
- [$excl_start , $excl_stop , \$exclude_region , 3 | EXCLUDE_REGION]);
5603
+ [$excl_start , $excl_stop ,
5604
+ \$exclude_region , 3 | EXCLUDE_REGION,
5605
+ $lcovutil::EXCL_START , $lcovutil::EXCL_STOP
5606
+ ]);
5604
5607
} else {
5605
5608
$excl_line = undef ;
5606
5609
}
5607
5610
5608
5611
if (defined ($lcovutil::cov_filter [$lcovutil::FILTER_EXCLUDE_BRANCH ])) {
5609
5612
push (@excludes ,
5610
5613
[$excl_ex_start , $excl_ex_stop ,
5611
- \$exclude_exception_region , 4 | EXCLUDE_BRANCH_REGION
5614
+ \$exclude_exception_region , 4 | EXCLUDE_BRANCH_REGION,
5615
+ $lcovutil::EXCL_BR_START , $lcovutil::EXCL_BR_STOP ,
5612
5616
],
5613
- [$excl_br_start , $excl_br_stop ,
5614
- \$exclude_br_region , 2 | EXCLUDE_BRANCH_REGION
5617
+ [$excl_br_start ,
5618
+ $excl_br_stop ,
5619
+ \$exclude_br_region ,
5620
+ 2 | EXCLUDE_BRANCH_REGION,
5621
+ $lcovutil::EXCL_EXCEPTION_BR_START ,
5622
+ $lcovutil::EXCL_EXCEPTION_BR_STOP ,
5615
5623
]);
5616
5624
} else {
5617
5625
$excl_br_line = undef ;
@@ -5632,18 +5640,24 @@ sub parseLines
5632
5640
}
5633
5641
5634
5642
foreach my $d (@excludes ) {
5643
+ # note: $d->[4] is the 'start' string (not converted to perl regexp)
5644
+ # $d->[5] is the 'stop' string
5635
5645
my ($start , $stop , $ref , $reason ) = @$d ;
5636
5646
if ($_ =~ $start ) {
5637
5647
lcovutil::ignorable_error($lcovutil::ERROR_MISMATCH ,
5638
- " $filename : overlapping exclude directives. Found $start at line $line - but no matching $stop for $start at line "
5639
- . $ref -> [0])
5648
+ " $filename : overlapping exclude directives. Found " .
5649
+ $d -> [4] .
5650
+ " at line $line - but no matching " . $d -> [5] .
5651
+ ' for ' . $d -> [4] . ' at line ' . $$ref -> [0])
5640
5652
if $$ref ;
5641
5653
$$ref = [$line , $reason ];
5642
5654
last ;
5643
5655
} elsif ($_ =~ $stop ) {
5644
5656
lcovutil::ignorable_error($lcovutil::ERROR_MISMATCH ,
5645
- " $filename : found $stop directive at line $line without matching $start directive"
5646
- ) unless $$ref ;
5657
+ " $filename : found " . $d -> [5] .
5658
+ " directive at line $line without matching " .
5659
+ $d -> [4] . ' directive' )
5660
+ unless $$ref ;
5647
5661
$$ref = undef ;
5648
5662
last ;
5649
5663
}
@@ -5675,22 +5689,24 @@ sub parseLines
5675
5689
$exclude_exception_region ? $exclude_exception_region -> [1] : 0
5676
5690
) | $exclude_branch_line | $exclude_exception_branch_line );
5677
5691
}
5678
- lcovutil::ignorable_error($lcovutil::ERROR_MISMATCH ,
5679
- " $filename : unmatched $lcovutil::EXCL_START at line " .
5680
- $exclude_region -> [0] .
5681
- " - saw EOF while looking for matching $lcovutil::EXCL_STOP "
5682
- ) if $exclude_region ;
5683
- lcovutil::ignorable_error($lcovutil::ERROR_MISMATCH ,
5684
- " $filename : unmatched $lcovutil::EXCL_BR_START at line " .
5685
- $exclude_br_region -> [0] .
5686
- " - saw EOF while looking for matching $lcovutil::EXCL_BR_STOP "
5687
- ) if $exclude_br_region ;
5688
- lcovutil::ignorable_error($lcovutil::ERROR_MISMATCH ,
5689
- " $filename : unmatched $lcovutil::EXCL_EXCEPTION_BR_START at line " .
5690
- $exclude_exception_region -> [0] .
5691
- " - saw EOF while looking for matching $lcovutil::EXCL_EXCEPTION_BR_STOP "
5692
- ) if $exclude_exception_region ;
5693
-
5692
+ foreach my $t ([$exclude_region , $lcovutil::EXCL_START ,
5693
+ $lcovutil::EXCL_STOP
5694
+ ],
5695
+ [$exclude_br_region , $lcovutil::EXCL_BR_START ,
5696
+ $lcovutil::EXCL_BR_STOP
5697
+ ],
5698
+ [$exclude_exception_region ,
5699
+ $lcovutil::EXCL_EXCEPTION_BR_START ,
5700
+ $lcovutil::EXCL_EXCEPTION_BR_STOP
5701
+ ]
5702
+ ) {
5703
+ my ($key , $start , $stop ) = @$t ;
5704
+ lcovutil::ignorable_error($lcovutil::ERROR_MISMATCH ,
5705
+ " $filename : unmatched $start at line " .
5706
+ $key -> [0] .
5707
+ " - saw EOF while looking for matching $stop "
5708
+ ) if ($key );
5709
+ }
5694
5710
my $data = $self -> [0];
5695
5711
$data -> [FILENAME] = $filename ;
5696
5712
$data -> [SOURCE] = $sourceLines ;
0 commit comments