aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
-rw-r--r--llvm/lib/ProfileData/Coverage/CoverageMapping.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index ce93229..6cde386 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -698,12 +698,12 @@ LineCoverageStats::LineCoverageStats(
if (!Mapped)
return;
- // Pick the max count from the non-gap, region entry segments. If there
- // aren't any, use the wrapped count.
- if (!MinRegionCount) {
+ // Pick the max count from the non-gap, region entry segments and the
+ // wrapped count.
+ if (WrappedSegment)
ExecutionCount = WrappedSegment->Count;
+ if (!MinRegionCount)
return;
- }
for (const auto *LS : LineSegments)
if (isStartOfRegion(LS))
ExecutionCount = std::max(ExecutionCount, LS->Count);