]> granicus.if.org Git - clang/commitdiff
Fix size calculation from r339380
authorRichard Trieu <rtrieu@google.com>
Fri, 10 Aug 2018 01:30:10 +0000 (01:30 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 10 Aug 2018 01:30:10 +0000 (01:30 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339409 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/ParsedAttr.h

index 34eb59eb43345f4fdb7d1d3c8a994cc9aaf80bb5..903702715ccf0e8c1e732530d0fa36e4af6b9552 100644 (file)
@@ -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,