From e3df9471750935876bd2bf7da93ccf0eacca8592 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 30 Jul 2020 23:36:31 -0700 Subject: [llvm-cov] reset executation count to 0 after wrapped segment Fix the bug: https://bugs.llvm.org/show_bug.cgi?id=36979. It also fixes this bug: https://bugs.llvm.org/show_bug.cgi?id=35404, which I think is caused by the same problem. Differential Revision: https://reviews.llvm.org/D85036 --- llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp') diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp index 70f00d3..3197f5d 100644 --- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp +++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp @@ -770,6 +770,7 @@ LineCoverageStats::LineCoverageStats( ExecutionCount = WrappedSegment->Count; if (!MinRegionCount) return; + ExecutionCount = 0; for (const auto *LS : LineSegments) if (isStartOfRegion(LS)) ExecutionCount = std::max(ExecutionCount, LS->Count); -- cgit v1.1