Skip to content

Commit 73e29e5

Browse files
committed
[clang][CoverageMapping] do not emit gap when either end is an ImplicitValueInitExpr
1 parent 48324f0 commit 73e29e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/CodeGen/CoverageMappingGen.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,9 @@ struct CounterCoverageMappingBuilder
13701370
// If last statement contains terminate statements, add a gap area
13711371
// between the two statements. Skipping attributed statements, because
13721372
// they don't have valid start location.
1373-
if (LastStmt && HasTerminateStmt && !isa<AttributedStmt>(Child)) {
1373+
if (LastStmt && HasTerminateStmt && !isa<AttributedStmt>(Child) &&
1374+
!isa<ImplicitValueInitExpr>(Child) &&
1375+
!isa<ImplicitValueInitExpr>(LastStmt)) {
13741376
auto Gap = findGapAreaBetween(getEnd(LastStmt), getStart(Child));
13751377
if (Gap)
13761378
fillGapAreaWithCount(Gap->getBegin(), Gap->getEnd(),

0 commit comments

Comments
 (0)