@@ -78,7 +78,7 @@ our @EXPORT_OK = qw($tool_name $tool_dir $lcov_version $lcov_url $VERSION
7878 %lcovErrors $ERROR_GCOV $ERROR_SOURCE $ERROR_GRAPH $ERROR_MISMATCH
7979 $ERROR_BRANCH $ERROR_EMPTY $ERROR_FORMAT $ERROR_VERSION $ERROR_UNUSED
8080 $ERROR_PACKAGE $ERROR_CORRUPT $ERROR_NEGATIVE $ERROR_COUNT $ERROR_PATH
81- $ERROR_UNSUPPORTED $ERROR_DEPRECATED $ERROR_INCONSISTENT_DATA
81+ $ERROR_UNSUPPORTED $ERROR_DEPRECATED $ERROR_INCONSISTENT_DATA $ERROR_MULTIPLE_BASIC_BLOCKS
8282 $ERROR_CALLBACK $ERROR_RANGE $ERROR_UTILITY $ERROR_USAGE $ERROR_INTERNAL
8383 $ERROR_PARALLEL $ERROR_PARENT $ERROR_CHILD $ERROR_FORK
8484 $ERROR_EXCESSIVE_COUNT $ERROR_MISSING $ERROR_UNREACHABLE
@@ -150,6 +150,7 @@ our $ERROR_PARALLEL; # error in fork/join
150150our $ERROR_DEPRECATED ; # deprecated feature
151151our $ERROR_CALLBACK ; # callback produced an error
152152our $ERROR_INCONSISTENT_DATA ; # something wrong with .info
153+ our $ERROR_MULTIPLE_BASIC_BLOCKS ;# source code line contains multiple blocks, e.g. functions
153154our $ERROR_UNREACHABLE ; # coverpoint hit in "unreachable" region
154155our $ERROR_RANGE ; # line number out of range
155156our $ERROR_UTILITY ; # some tool failed - e.g., 'find'
@@ -181,6 +182,7 @@ my @lcovErrs = (["annotate", \$ERROR_ANNOTATE_SCRIPT],
181182 [" gcov" , \$ERROR_GCOV ],
182183 [" graph" , \$ERROR_GRAPH ],
183184 [" inconsistent" , \$ERROR_INCONSISTENT_DATA ],
185+ [" multiple" , \$ERROR_MULTIPLE_BASIC_BLOCKS ],
184186 [" internal" , \$ERROR_INTERNAL ],
185187 [" mismatch" , \$ERROR_MISMATCH ],
186188 [" missing" , \$ERROR_MISSING ],
@@ -5220,20 +5222,26 @@ sub define_function
52205222 $end_line == $data -> end_line()) ||
52215223 (!defined ($end_line ) && !defined ($data -> end_line()))
52225224 ) {
5223- lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA ,
5224- " mismatched end line for $fnName at " .
5225- $self -> filename() .
5226- " :$start_line : "
5227- .
5228- (defined ($data -> end_line()) ?
5229- $data -> end_line() : ' undef' ) .
5230- " -> "
5231- .
5232- (defined ($end_line ) ? $end_line :
5233- ' undef' ) .
5234- MessageContext::context())
5235- unless
5236- grep ({ $fnName =~ $_ } @lcovutil::suppress_function_patterns );
5225+ if ($fnName ne $data -> name()) {
5226+ lcovutil::ignorable_warning($lcovutil::ERROR_MULTIPLE_BASIC_BLOCKS ,
5227+ " another block for $fnName overlaps with " .$data -> name()." at " .
5228+ $self -> filename() . " :$start_line " .
5229+ MessageContext::context());
5230+ } else {
5231+ lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA ,
5232+ " mismatched end line for $fnName at " .
5233+ $self -> filename() . " :$start_line : "
5234+ .
5235+ (defined ($data -> end_line()) ?
5236+ $data -> end_line() : ' undef' ) .
5237+ " -> "
5238+ .
5239+ (defined ($end_line ) ? $end_line :
5240+ ' undef' ) .
5241+ MessageContext::context())
5242+ unless
5243+ grep ({ $fnName =~ $_ } @lcovutil::suppress_function_patterns );
5244+ }
52375245 # pick the highest end line if we didn't error out
52385246 $data -> set_end_line($end_line )
52395247 if (defined ($end_line ) &&
0 commit comments