Author: Zequan Wu
Date: 2023-09-19T14:59:41-04:00
New Revision: 816144bfd2d86701020c0c7b693d403f8fc8dffe

URL: 
https://github.com/llvm/llvm-project/commit/816144bfd2d86701020c0c7b693d403f8fc8dffe
DIFF: 
https://github.com/llvm/llvm-project/commit/816144bfd2d86701020c0c7b693d403f8fc8dffe.diff

LOG: [Coverage] Skip visiting ctor member initializers with invalid source 
locations.

Added: 
    

Modified: 
    clang/lib/CodeGen/CoverageMappingGen.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CoverageMappingGen.cpp 
b/clang/lib/CodeGen/CoverageMappingGen.cpp
index bb814dfbfd580f1..32c67739915380c 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -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);
         }
       }
     }


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to