@@ -4215,18 +4215,20 @@ sub removeExceptionBranches
4215
4215
push (@replace , $br );
4216
4216
}
4217
4217
}
4218
- if (0 == scalar (@replace )) {
4219
- lcovutil::info(2, " $line : remove exception block $block_id \n " );
4220
-
4221
- $blockData -> removeBlock($block_id , $brdata );
4222
- } else {
4218
+ # If there is only one branch left - then this is not a conditional
4219
+ # perhaps that should be a separate 'orphan' filter
4220
+ if (2 > scalar (@replace )) {
4221
+ lcovutil::info(2,
4222
+ " $line : remove " .
4223
+ (1 == scalar (@replace ) ? ' orphan ' : ' ' ) .
4224
+ " exception block $block_id \n " );
4225
+ $brdata -> removeBlock($block_id , $self );
4226
+ } elsif ($modified ) {
4223
4227
@$blockData = @replace ;
4224
4228
}
4225
4229
}
4226
- # If there is only one branch left - then this is not a conditional
4227
- if (2 > scalar ($brdata -> blocks())) {
4228
- lcovutil::info(2, " $line : lone block\n " )
4229
- if 1 == scalar ($brdata -> blocks());
4230
+ if (0 == scalar ($brdata -> blocks())) {
4231
+ lcovutil::info(2, " $line : no branches remain\n " );
4230
4232
$self -> remove($line );
4231
4233
$modified = 1;
4232
4234
}
@@ -5719,7 +5721,7 @@ sub _deriveFunctionEndLines
5719
5721
} else {
5720
5722
my $suffix = lcovutil::explain_once(' derive_end_line' ,
5721
5723
" See lcovrc man entry for 'derive_function_end_line'."
5722
- );
5724
+ );
5723
5725
lcovutil::ignorable_error(
5724
5726
$lcovutil::ERROR_INCONSISTENT_DATA ,
5725
5727
' "' . $traceInfo -> filenname() .
0 commit comments