Skip to content

Commit 816144b

Browse files
committed
[Coverage] Skip visiting ctor member initializers with invalid source locations.
1 parent 209c242 commit 816144b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/CodeGen/CoverageMappingGen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,8 @@ struct CounterCoverageMappingBuilder
10441044
for (auto *Initializer : Ctor->inits()) {
10451045
if (Initializer->isWritten()) {
10461046
auto *Init = Initializer->getInit();
1047-
propagateCounts(BodyCounter, Init);
1047+
if (getStart(Init).isValid() && getEnd(Init).isValid())
1048+
propagateCounts(BodyCounter, Init);
10481049
}
10491050
}
10501051
}

0 commit comments

Comments
 (0)