]> granicus.if.org Git - clang/commitdiff
[comment parsing]: Removes an unsafe API whose
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 5 Jul 2013 23:20:55 +0000 (23:20 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 5 Jul 2013 23:20:55 +0000 (23:20 +0000)
use can cause crash. No test is available. It is uncovered
by code browsing.  // rdar://14348205

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

include/clang/AST/Comment.h
lib/AST/Comment.cpp

index d943ad2454c0cba3fca42670466b7bcc053c84bb..ac3eafffeeb054ebc6b2e9d5d8d65bcf49e498ca 100644 (file)
@@ -1111,10 +1111,6 @@ public:
     return ThisDeclInfo;
   }
   
-  DeclInfo *getThisDeclInfo() const LLVM_READONLY {
-    return ThisDeclInfo;
-  }
-  
   ArrayRef<BlockContentComment *> getBlocks() const { return Blocks; }
   
 };
index 058485e3fdeefe0c81d07477bc6af5cddae6902c..a16a023e95a09b17620d4cad96f24161d8934082 100644 (file)
@@ -295,12 +295,12 @@ StringRef ParamCommandComment::getParamName(const FullComment *FC) const {
   assert(isParamIndexValid());
   if (isVarArgParam())
     return "...";
-  return FC->getThisDeclInfo()->ParamVars[getParamIndex()]->getName();
+  return FC->getDeclInfo()->ParamVars[getParamIndex()]->getName();
 }
 
 StringRef TParamCommandComment::getParamName(const FullComment *FC) const {
   assert(isPositionValid());
-  const TemplateParameterList *TPL = FC->getThisDeclInfo()->TemplateParameters;
+  const TemplateParameterList *TPL = FC->getDeclInfo()->TemplateParameters;
   for (unsigned i = 0, e = getDepth(); i != e; ++i) {
     if (i == e-1)
       return TPL->getParam(getIndex(i))->getName();