]> granicus.if.org Git - clang/commitdiff
ObjectiveC Generics: follow-up commit to r281355.
authorManman Ren <manman.ren@gmail.com>
Tue, 13 Sep 2016 21:57:28 +0000 (21:57 +0000)
committerManman Ren <manman.ren@gmail.com>
Tue, 13 Sep 2016 21:57:28 +0000 (21:57 +0000)
Correct getExtraLocalDataSize for ObjCTypeParamTypeLoc.

rdar://24619481
rdar://25060179

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

include/clang/AST/TypeLoc.h

index 5d7770d80549659898e31d31bd071edbaa79d736..d3db024bc65ba863b15c4838afbf1003ad701d01 100644 (file)
@@ -763,7 +763,9 @@ public:
 
   unsigned getExtraLocalDataSize() const {
     if (!this->getNumProtocols()) return 0;
-    return this->getNumProtocols() * sizeof(SourceLocation) ;
+    // When there are protocol qualifers, we have LAngleLoc and RAngleLoc
+    // as well.
+    return (this->getNumProtocols() + 2) * sizeof(SourceLocation) ;
   }
   unsigned getExtraLocalDataAlignment() const {
     return llvm::alignOf<SourceLocation>();