[clang] 8627179 - [clang][Interp] Only initialize initmaps for primitive arrays

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 8 01:03:33 PDT 2022


Author: Timm Bäder
Date: 2022-09-08T10:03:06+02:00
New Revision: 86271798e51a7866dd2af44e0ee183d1331089e6

URL: https://github.com/llvm/llvm-project/commit/86271798e51a7866dd2af44e0ee183d1331089e6
DIFF: https://github.com/llvm/llvm-project/commit/86271798e51a7866dd2af44e0ee183d1331089e6.diff

LOG: [clang][Interp] Only initialize initmaps for primitive arrays

As the comment states, this code should only run for primitive arrays.

This should fix the memory sanitize builds.

Added: 
    

Modified: 
    clang/lib/AST/Interp/Pointer.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Pointer.cpp b/clang/lib/AST/Interp/Pointer.cpp
index cb687377e97b..1dfb8f4b18eb 100644
--- a/clang/lib/AST/Interp/Pointer.cpp
+++ b/clang/lib/AST/Interp/Pointer.cpp
@@ -156,7 +156,7 @@ void Pointer::initialize() const {
   Descriptor *Desc = getFieldDesc();
 
   if (Desc->isArray()) {
-    if (!Pointee->IsStatic) {
+    if (Desc->isPrimitiveArray() && !Pointee->IsStatic) {
       // Primitive array initializer.
       InitMap *&Map = getInitMap();
       if (Map == (InitMap *)-1)


        


More information about the cfe-commits mailing list