Author: rtrieu
Date: Thu Aug  9 18:30:10 2018
New Revision: 339409

URL: http://llvm.org/viewvc/llvm-project?rev=339409&view=rev
Log:
Fix size calculation from r339380

r339380 changed the trailing types of ParsedAttr to use llvm::TrailingObjects.
However, it did not copy over one of the size attributes, causing a too
small allocation for this object.  The error was detected with
AddressSanitizer use-after-poison

Modified:
    cfe/trunk/include/clang/Sema/ParsedAttr.h

Modified: cfe/trunk/include/clang/Sema/ParsedAttr.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ParsedAttr.h?rev=339409&r1=339408&r2=339409&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/ParsedAttr.h (original)
+++ cfe/trunk/include/clang/Sema/ParsedAttr.h Thu Aug  9 18:30:10 2018
@@ -581,7 +581,7 @@ public:
     TypeTagForDatatypeAllocSize =
         ParsedAttr::totalSizeToAlloc<ArgsUnion, detail::AvailabilityData,
                                      detail::TypeTagForDatatypeData, 
ParsedType,
-                                     detail::PropertyData>(0, 0, 1, 0, 0),
+                                     detail::PropertyData>(1, 0, 1, 0, 0),
     PropertyAllocSize =
         ParsedAttr::totalSizeToAlloc<ArgsUnion, detail::AvailabilityData,
                                      detail::TypeTagForDatatypeData, 
ParsedType,


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

Reply via email to