<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I checked in r281404. Hopefully it will fix the issue.<div class=""><br class=""></div><div class="">Let me know if it does not.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Manman</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 13, 2016, at 3:03 PM, Artem Belevich via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Manman,<div class=""><br class=""></div><div class="">FYI, It appears that some of your ObjC commits today trigger asan error.</div><div class="">Sanitizer bots are broken by PR30341, so they don't report the issue yet.</div><div class=""><br class=""></div><div class="">--Artem</div><div class=""><br class=""></div><div class=""><div class="">$ llvm/tools/clang/clang -cc1 -internal-isystem llvm/tools/clang/staging/include -nostdsysteminc -fblocks -fsyntax-only -Wnullable-to-nonnull-conversion llvm/tools/clang/test/SemaObjC/parameterized_classes_subst.m -verify</div><div class="">=================================================================</div><div class="">==223101==ERROR: AddressSanitizer: use-after-poison on address 0x621000091288 at pc 0x000001a02b3f bp 0x7fffff2996f0 sp 0x7fffff2996e8</div><div class="">WRITE of size 4 at 0x621000091288 thread T0</div><div class=""> #0 0x1a02b3e in clang::ObjCTypeParamTypeLoc::setProtocolRAngleLoc(clang::SourceLocation) third_party/llvm/llvm/tools/clang/include/clang/AST/TypeLoc.h:737:55</div><div class=""> #1 0x213f86b in clang::Sema::actOnObjCTypeArgsAndProtocolQualifiers(clang::Scope*, clang::SourceLocation, clang::OpaquePtr<clang::QualType>, clang::SourceLocation, llvm::ArrayRef<clang::OpaquePtr<clang::QualType> >, clang::SourceLocation, clang::SourceLocation, llvm::ArrayRef<clang::Decl*>, llvm::ArrayRef<clang::SourceLocation>, clang::SourceLocation) third_party/llvm/llvm/tools/clang/lib/Sema/SemaType.cpp:1165:13</div><div class=""> #2 0x2060347 in clang::Parser::parseObjCTypeArgsAndProtocolQualifiers(clang::SourceLocation, clang::OpaquePtr<clang::QualType>, bool, clang::SourceLocation&) third_party/llvm/llvm/tools/clang/lib/Parse/ParseObjc.cpp:1878:18</div><div class=""> #3 0x1ffca6f in clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(bool, bool, clang::CXXScopeSpec&, bool) third_party/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:1770:13</div><div class=""> #4 0x1ffd4fc in clang::Parser::TryAnnotateTypeOrScopeToken(bool, bool) third_party/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:1733:10</div><div class=""> #5 0x20df910 in clang::Parser::isTypeSpecifierQualifier() third_party/llvm/llvm/tools/clang/lib/Parse/ParseDecl.cpp:4381:9</div><div class=""> #6 0x205ecf5 in clang::Parser::ParseObjCTypeName(clang::ObjCDeclSpec&, clang::Declarator::TheContext, clang::ParsedAttributes*) third_party/llvm/llvm/tools/clang/lib/Parse/ParseObjc.cpp:1274:7</div><div class=""> #7 0x205c8f9 in clang::Parser::ParseObjCMethodDecl(clang::SourceLocation, clang::tok::TokenKind, clang::tok::ObjCKeywordKind, bool) third_party/llvm/llvm/tools/clang/lib/Parse/ParseObjc.cpp:1428:22</div><div class=""> #8 0x2058e8b in clang::Parser::ParseObjCInterfaceDeclList(clang::tok::ObjCKeywordKind, clang::Decl*) third_party/llvm/llvm/tools/clang/lib/Parse/ParseObjc.cpp:633:11</div><div class=""> #9 0x2053154 in clang::Parser::ParseObjCAtInterfaceDeclaration(clang::SourceLocation, clang::ParsedAttributes&) third_party/llvm/llvm/tools/clang/lib/Parse/ParseObjc.cpp:388:3</div><div class=""> #10 0x2051fa9 in clang::Parser::ParseObjCAtDirectives() third_party/llvm/llvm/tools/clang/lib/Parse/ParseObjc.cpp:63:18</div><div class=""> #11 0x1ff7871 in clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) third_party/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:757:12</div><div class=""> #12 0x1ff6c61 in clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) third_party/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:628:12</div><div class=""> #13 0x1ff016d in clang::ParseAST(clang::Sema&, bool, bool) third_party/llvm/llvm/tools/clang/lib/Parse/ParseAST.cpp:147:18</div><div class=""> #14 0x1ab05d3 in clang::FrontendAction::Execute() third_party/llvm/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:458:8</div><div class=""> #15 0x184fbd6 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) third_party/llvm/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:871:11</div><div class=""> #16 0x5c6f47 in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) third_party/llvm/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:249:25</div><div class=""> #17 0x5a114d in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) third_party/llvm/llvm/tools/clang/tools/driver/cc1_main.cpp:183:13</div><div class=""> #18 0x5bb3f6 in ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) third_party/llvm/llvm/tools/clang/tools/driver/driver.cpp:299:12</div><div class=""> #19 0x5ba314 in main third_party/llvm/llvm/tools/clang/tools/driver/driver.cpp:380:12</div><div class=""><br class=""></div><div class="">0x621000091288 is located 392 bytes inside of 4096-byte region [0x621000091100,0x621000092100)</div><div class="">allocated by thread T0 here:</div><div class=""> #0 0x58a52c in __interceptor_malloc third_party/llvm/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64:3</div><div class=""> #1 0x5a5d0b in llvm::MallocAllocator::Allocate(unsigned long, unsigned long) third_party/llvm/llvm/include/llvm/Support/Allocator.h:95:12</div><div class=""> #2 0x691b67 in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>::StartNewSlab() third_party/llvm/llvm/include/llvm/Support/Allocator.h:324:31</div><div class=""> #3 0x6916aa in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>::Allocate(unsigned long, unsigned long) third_party/llvm/llvm/include/llvm/Support/Allocator.h:249:5</div><div class=""> #4 0x6913d1 in clang::ASTContext::Allocate(unsigned long, unsigned int) const third_party/llvm/llvm/tools/clang/include/clang/AST/ASTContext.h:588:22</div><div class=""> #5 0x3010c16 in clang::ObjCInterfaceDecl::Create(clang::ASTContext const&, clang::DeclContext*, clang::SourceLocation, clang::IdentifierInfo*, clang::ObjCTypeParamList*, clang::ObjCInterfaceDecl*, clang::SourceLocation, bool) third_party/llvm/llvm/tools/clang/lib/AST/DeclObjC.cpp:1396:31</div><div class=""> #6 0x2838c96 in clang::Sema::ActOnStartClassInterface(clang::Scope*, clang::SourceLocation, clang::IdentifierInfo*, clang::SourceLocation, clang::ObjCTypeParamList*, clang::IdentifierInfo*, clang::SourceLocation, llvm::ArrayRef<clang::OpaquePtr<clang::QualType> >, clang::SourceRange, clang::Decl* const*, unsigned int, clang::SourceLocation const*, clang::SourceLocation, clang::AttributeList*) third_party/llvm/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp:981:7</div><div class=""> #7 0x2053112 in clang::Parser::ParseObjCAtInterfaceDeclaration(clang::SourceLocation, clang::ParsedAttributes&) third_party/llvm/llvm/tools/clang/lib/Parse/ParseObjc.cpp:375:13</div><div class=""> #8 0x2051fa9 in clang::Parser::ParseObjCAtDirectives() third_party/llvm/llvm/tools/clang/lib/Parse/ParseObjc.cpp:63:18</div><div class=""> #9 0x1ff7871 in clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) third_party/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:757:12</div><div class=""> #10 0x1ff6c61 in clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) third_party/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:628:12</div><div class=""> #11 0x1ff016d in clang::ParseAST(clang::Sema&, bool, bool) third_party/llvm/llvm/tools/clang/lib/Parse/ParseAST.cpp:147:18</div><div class=""> #12 0x1ab05d3 in clang::FrontendAction::Execute() third_party/llvm/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:458:8</div><div class=""> #13 0x184fbd6 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) third_party/llvm/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:871:11</div><div class=""> #14 0x5c6f47 in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) third_party/llvm/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:249:25</div><div class=""> #15 0x5a114d in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) third_party/llvm/llvm/tools/clang/tools/driver/cc1_main.cpp:183:13</div><div class=""> #16 0x5bb3f6 in ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) third_party/llvm/llvm/tools/clang/tools/driver/driver.cpp:299:12</div><div class=""> #17 0x5ba314 in main third_party/llvm/llvm/tools/clang/tools/driver/driver.cpp:380:12</div><div class=""><br class=""></div><div class="">SUMMARY: AddressSanitizer: use-after-poison third_party/llvm/llvm/tools/clang/include/clang/AST/TypeLoc.h:737:55 in clang::ObjCTypeParamTypeLoc::setProtocolRAngleLoc(clang::SourceLocation)</div><div class="">Shadow bytes around the buggy address:</div><div class=""> 0x0c428000a200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa</div><div class=""> 0x0c428000a210: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa</div><div class=""> 0x0c428000a220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</div><div class=""> 0x0c428000a230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</div><div class=""> 0x0c428000a240: 00 00 00 04 00 04 00 04 00 00 00 00 00 00 00 00</div><div class="">=>0x0c428000a250: 00[f7]f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7</div><div class=""> 0x0c428000a260: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7</div><div class=""> 0x0c428000a270: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7</div><div class=""> 0x0c428000a280: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7</div><div class=""> 0x0c428000a290: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7</div><div class=""> 0x0c428000a2a0: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7</div><div class="">Shadow byte legend (one shadow byte represents 8 application bytes):</div><div class=""> Addressable: 00</div><div class=""> Partially addressable: 01 02 03 04 05 06 07 </div><div class=""> Heap left redzone: fa</div><div class=""> Heap right redzone: fb</div><div class=""> Freed heap region: fd</div><div class=""> Stack left redzone: f1</div><div class=""> Stack mid redzone: f2</div><div class=""> Stack right redzone: f3</div><div class=""> Stack partial redzone: f4</div><div class=""> Stack after return: f5</div><div class=""> Stack use after scope: f8</div><div class=""> Global redzone: f9</div><div class=""> Global init order: f6</div><div class=""> Poisoned by user: f7</div><div class=""> Container overflow: fc</div><div class=""> Array cookie: ac</div><div class=""> Intra object redzone: bb</div><div class=""> ASan internal: fe</div><div class=""> Left alloca redzone: ca</div><div class=""> Right alloca redzone: cb</div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Sep 13, 2016 at 9:45 AM, Manman Ren via cfe-commits <span dir="ltr" class=""><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mren<br class="">
Date: Tue Sep 13 11:45:29 2016<br class="">
New Revision: 281351<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=281351&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project?rev=281351&view=rev</a><br class="">
Log:<br class="">
Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.<br class="">
<br class="">
Now ObjCObjectType extends from ObjCProtocolQualifiers. We save number of<br class="">
protocols in ObjCProtocolQualifiers.<br class="">
<br class="">
This is in preparation of adding a new type class ObjCTypeParamType that<br class="">
can take protocol qualifiers.<br class="">
<br class="">
<a href="rdar://24619481" class="">rdar://24619481</a><br class="">
<a href="rdar://25060179" class="">rdar://25060179</a><br class="">
<br class="">
Differential Revision: <a href="http://reviews.llvm.org/D23078" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D23078</a><br class="">
<br class="">
Modified:<br class="">
cfe/trunk/include/clang/AST/<wbr class="">Type.h<br class="">
cfe/trunk/lib/AST/Type.cpp<br class="">
<br class="">
Modified: cfe/trunk/include/clang/AST/<wbr class="">Type.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=281351&r1=281350&r2=281351&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/cfe/trunk/include/<wbr class="">clang/AST/Type.h?rev=281351&<wbr class="">r1=281350&r2=281351&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- cfe/trunk/include/clang/AST/<wbr class="">Type.h (original)<br class="">
+++ cfe/trunk/include/clang/AST/<wbr class="">Type.h Tue Sep 13 11:45:29 2016<br class="">
@@ -4699,6 +4699,59 @@ public:<br class="">
}<br class="">
};<br class="">
<br class="">
+/// This class wraps the list of protocol qualifiers. For types that can<br class="">
+/// take ObjC protocol qualifers, they can subclass this class.<br class="">
+template <class T><br class="">
+class ObjCProtocolQualifiers {<br class="">
+protected:<br class="">
+ ObjCProtocolQualifiers() {}<br class="">
+ ObjCProtocolDecl * const *getProtocolStorage() const {<br class="">
+ return const_cast<<wbr class="">ObjCProtocolQualifiers*>(this)<wbr class="">->getProtocolStorage();<br class="">
+ }<br class="">
+<br class="">
+ ObjCProtocolDecl **getProtocolStorage() {<br class="">
+ return static_cast<T*>(this)-><wbr class="">getProtocolStorageImpl();<br class="">
+ }<br class="">
+ void setNumProtocols(unsigned N) {<br class="">
+ static_cast<T*>(this)-><wbr class="">setNumProtocolsImpl(N);<br class="">
+ }<br class="">
+ void initialize(ArrayRef<<wbr class="">ObjCProtocolDecl *> protocols) {<br class="">
+ setNumProtocols(protocols.<wbr class="">size());<br class="">
+ assert(getNumProtocols() == protocols.size() &&<br class="">
+ "bitfield overflow in protocol count");<br class="">
+ if (!protocols.empty())<br class="">
+ memcpy(getProtocolStorage(), protocols.data(),<br class="">
+ protocols.size() * sizeof(ObjCProtocolDecl*));<br class="">
+ }<br class="">
+<br class="">
+public:<br class="">
+ typedef ObjCProtocolDecl * const *qual_iterator;<br class="">
+ typedef llvm::iterator_range<qual_<wbr class="">iterator> qual_range;<br class="">
+<br class="">
+ qual_range quals() const { return qual_range(qual_begin(), qual_end()); }<br class="">
+ qual_iterator qual_begin() const { return getProtocolStorage(); }<br class="">
+ qual_iterator qual_end() const { return qual_begin() + getNumProtocols(); }<br class="">
+<br class="">
+ bool qual_empty() const { return getNumProtocols() == 0; }<br class="">
+<br class="">
+ /// Return the number of qualifying protocols in this type, or 0 if<br class="">
+ /// there are none.<br class="">
+ unsigned getNumProtocols() const {<br class="">
+ return static_cast<const T*>(this)-><wbr class="">getNumProtocolsImpl();<br class="">
+ }<br class="">
+<br class="">
+ /// Fetch a protocol by index.<br class="">
+ ObjCProtocolDecl *getProtocol(unsigned I) const {<br class="">
+ assert(I < getNumProtocols() && "Out-of-range protocol access");<br class="">
+ return qual_begin()[I];<br class="">
+ }<br class="">
+<br class="">
+ /// Retrieve all of the protocol qualifiers.<br class="">
+ ArrayRef<ObjCProtocolDecl *> getProtocols() const {<br class="">
+ return ArrayRef<ObjCProtocolDecl *>(qual_begin(), getNumProtocols());<br class="">
+ }<br class="">
+};<br class="">
+<br class="">
/// Represents a class type in Objective C.<br class="">
///<br class="">
/// Every Objective C type is a combination of a base type, a set of<br class="">
@@ -4727,7 +4780,9 @@ public:<br class="">
/// 'id<P>' is an ObjCObjectPointerType whose pointee is an ObjCObjectType<br class="">
/// with base BuiltinType::ObjCIdType and protocol list [P]. Eventually<br class="">
/// this should get its own sugar class to better represent the source.<br class="">
-class ObjCObjectType : public Type {<br class="">
+class ObjCObjectType : public Type,<br class="">
+ public ObjCProtocolQualifiers<<wbr class="">ObjCObjectType> {<br class="">
+ friend class ObjCProtocolQualifiers<<wbr class="">ObjCObjectType>;<br class="">
// ObjCObjectType.NumTypeArgs - the number of type arguments stored<br class="">
// after the ObjCObjectPointerType node.<br class="">
// ObjCObjectType.NumProtocols - the number of protocols stored<br class="">
@@ -4747,16 +4802,20 @@ class ObjCObjectType : public Type {<br class="">
mutable llvm::PointerIntPair<const ObjCObjectType *, 1, bool><br class="">
CachedSuperClassType;<br class="">
<br class="">
- ObjCProtocolDecl * const *getProtocolStorage() const {<br class="">
- return const_cast<ObjCObjectType*>(<wbr class="">this)->getProtocolStorage();<br class="">
- }<br class="">
-<br class="">
QualType *getTypeArgStorage();<br class="">
const QualType *getTypeArgStorage() const {<br class="">
return const_cast<ObjCObjectType *>(this)->getTypeArgStorage();<br class="">
}<br class="">
<br class="">
- ObjCProtocolDecl **getProtocolStorage();<br class="">
+ ObjCProtocolDecl **getProtocolStorageImpl();<br class="">
+ /// Return the number of qualifying protocols in this interface type,<br class="">
+ /// or 0 if there are none.<br class="">
+ unsigned getNumProtocolsImpl() const {<br class="">
+ return ObjCObjectTypeBits.<wbr class="">NumProtocols;<br class="">
+ }<br class="">
+ void setNumProtocolsImpl(unsigned N) {<br class="">
+ ObjCObjectTypeBits.<wbr class="">NumProtocols = N;<br class="">
+ }<br class="">
<br class="">
protected:<br class="">
ObjCObjectType(QualType Canonical, QualType Base,<br class="">
@@ -4833,30 +4892,6 @@ public:<br class="">
ObjCObjectTypeBits.<wbr class="">NumTypeArgs);<br class="">
}<br class="">
<br class="">
- typedef ObjCProtocolDecl * const *qual_iterator;<br class="">
- typedef llvm::iterator_range<qual_<wbr class="">iterator> qual_range;<br class="">
-<br class="">
- qual_range quals() const { return qual_range(qual_begin(), qual_end()); }<br class="">
- qual_iterator qual_begin() const { return getProtocolStorage(); }<br class="">
- qual_iterator qual_end() const { return qual_begin() + getNumProtocols(); }<br class="">
-<br class="">
- bool qual_empty() const { return getNumProtocols() == 0; }<br class="">
-<br class="">
- /// Return the number of qualifying protocols in this interface type,<br class="">
- /// or 0 if there are none.<br class="">
- unsigned getNumProtocols() const { return ObjCObjectTypeBits.<wbr class="">NumProtocols; }<br class="">
-<br class="">
- /// Fetch a protocol by index.<br class="">
- ObjCProtocolDecl *getProtocol(unsigned I) const {<br class="">
- assert(I < getNumProtocols() && "Out-of-range protocol access");<br class="">
- return qual_begin()[I];<br class="">
- }<br class="">
-<br class="">
- /// Retrieve all of the protocol qualifiers.<br class="">
- ArrayRef<ObjCProtocolDecl *> getProtocols() const {<br class="">
- return ArrayRef<ObjCProtocolDecl *>(qual_begin(), getNumProtocols());<br class="">
- }<br class="">
-<br class="">
/// Whether this is a "__kindof" type as written.<br class="">
bool isKindOfTypeAsWritten() const { return ObjCObjectTypeBits.IsKindOf; }<br class="">
<br class="">
@@ -4919,7 +4954,7 @@ inline QualType *ObjCObjectType::getType<br class="">
return reinterpret_cast<QualType *>(static_cast<<wbr class="">ObjCObjectTypeImpl*>(this)+1);<br class="">
}<br class="">
<br class="">
-inline ObjCProtocolDecl **ObjCObjectType::<wbr class="">getProtocolStorage() {<br class="">
+inline ObjCProtocolDecl **ObjCObjectType::<wbr class="">getProtocolStorageImpl() {<br class="">
return reinterpret_cast<<wbr class="">ObjCProtocolDecl**>(<br class="">
getTypeArgStorage() + ObjCObjectTypeBits.<wbr class="">NumTypeArgs);<br class="">
}<br class="">
<br class="">
Modified: cfe/trunk/lib/AST/Type.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=281351&r1=281350&r2=281351&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/cfe/trunk/lib/AST/<wbr class="">Type.cpp?rev=281351&r1=281350&<wbr class="">r2=281351&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- cfe/trunk/lib/AST/Type.cpp (original)<br class="">
+++ cfe/trunk/lib/AST/Type.cpp Tue Sep 13 11:45:29 2016<br class="">
@@ -546,15 +546,9 @@ ObjCObjectType::<wbr class="">ObjCObjectType(QualType<br class="">
ObjCObjectTypeBits.NumTypeArgs = typeArgs.size();<br class="">
assert(getTypeArgsAsWritten().<wbr class="">size() == typeArgs.size() &&<br class="">
"bitfield overflow in type argument count");<br class="">
- ObjCObjectTypeBits.<wbr class="">NumProtocols = protocols.size();<br class="">
- assert(getNumProtocols() == protocols.size() &&<br class="">
- "bitfield overflow in protocol count");<br class="">
if (!typeArgs.empty())<br class="">
memcpy(getTypeArgStorage(), typeArgs.data(),<br class="">
typeArgs.size() * sizeof(QualType));<br class="">
- if (!protocols.empty())<br class="">
- memcpy(getProtocolStorage(), protocols.data(),<br class="">
- protocols.size() * sizeof(ObjCProtocolDecl*));<br class="">
<br class="">
for (auto typeArg : typeArgs) {<br class="">
if (typeArg->isDependentType())<br class="">
@@ -565,6 +559,9 @@ ObjCObjectType::<wbr class="">ObjCObjectType(QualType<br class="">
if (typeArg-><wbr class="">containsUnexpandedParameterPac<wbr class="">k())<br class="">
setContainsUnexpandedParameter<wbr class="">Pack();<br class="">
}<br class="">
+ // Initialize the protocol qualifiers. The protocol storage is known<br class="">
+ // after we set number of type arguments.<br class="">
+ initialize(protocols);<br class="">
}<br class="">
<br class="">
bool ObjCObjectType::isSpecialized(<wbr class="">) const {<br class="">
<br class="">
<br class="">
______________________________<wbr class="">_________________<br class="">
cfe-commits mailing list<br class="">
<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/cfe-commits</a><br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class="">--Artem Belevich</div></div>
</div>
_______________________________________________<br class="">cfe-commits mailing list<br class=""><a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits<br class=""></div></blockquote></div><br class=""></div></body></html>