r339409 - Fix size calculation from r339380

Richard Trieu via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 9 18:30:10 PDT 2018


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,




More information about the cfe-commits mailing list