@@ -5600,18 +5600,26 @@ sub parseLines
56005600 my @excludes ;
56015601 if (defined ($lcovutil::cov_filter [$lcovutil::FILTER_EXCLUDE_REGION ])) {
56025602 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+ ]);
56045607 } else {
56055608 $excl_line = undef ;
56065609 }
56075610
56085611 if (defined ($lcovutil::cov_filter [$lcovutil::FILTER_EXCLUDE_BRANCH ])) {
56095612 push (@excludes ,
56105613 [$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 ,
56125616 ],
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 ,
56155623 ]);
56165624 } else {
56175625 $excl_br_line = undef ;
@@ -5632,18 +5640,24 @@ sub parseLines
56325640 }
56335641
56345642 foreach my $d (@excludes ) {
5643+ # note: $d->[4] is the 'start' string (not converted to perl regexp)
5644+ # $d->[5] is the 'stop' string
56355645 my ($start , $stop , $ref , $reason ) = @$d ;
56365646 if ($_ =~ $start ) {
56375647 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])
56405652 if $$ref ;
56415653 $$ref = [$line , $reason ];
56425654 last ;
56435655 } elsif ($_ =~ $stop ) {
56445656 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 ;
56475661 $$ref = undef ;
56485662 last ;
56495663 }
@@ -5675,22 +5689,24 @@ sub parseLines
56755689 $exclude_exception_region ? $exclude_exception_region -> [1] : 0
56765690 ) | $exclude_branch_line | $exclude_exception_branch_line );
56775691 }
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+ }
56945710 my $data = $self -> [0];
56955711 $data -> [FILENAME] = $filename ;
56965712 $data -> [SOURCE] = $sourceLines ;
0 commit comments