From eb9c55fdfa25d97f61c04f4f06fd499d988045c0 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 5 Jul 2013 23:20:55 +0000 Subject: [PATCH] [comment parsing]: Removes an unsafe API whose 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 | 4 ---- lib/AST/Comment.cpp | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/clang/AST/Comment.h b/include/clang/AST/Comment.h index d943ad2454..ac3eafffee 100644 --- a/include/clang/AST/Comment.h +++ b/include/clang/AST/Comment.h @@ -1111,10 +1111,6 @@ public: return ThisDeclInfo; } - DeclInfo *getThisDeclInfo() const LLVM_READONLY { - return ThisDeclInfo; - } - ArrayRef getBlocks() const { return Blocks; } }; diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index 058485e3fd..a16a023e95 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -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(); -- 2.50.1