Skip to content

Commit

Permalink
[Coverage] Skip visiting ctor member initializers with invalid source…
Browse files Browse the repository at this point in the history
… locations.
  • Loading branch information
ZequanWu committed Sep 19, 2023
1 parent 209c242 commit 816144b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang/lib/CodeGen/CoverageMappingGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,8 @@ struct CounterCoverageMappingBuilder
for (auto *Initializer : Ctor->inits()) {
if (Initializer->isWritten()) {
auto *Init = Initializer->getInit();
propagateCounts(BodyCounter, Init);
if (getStart(Init).isValid() && getEnd(Init).isValid())
propagateCounts(BodyCounter, Init);
}
}
}
Expand Down

0 comments on commit 816144b

Please sign in to comment.