diff options
Diffstat (limited to 'lib/AST/RawCommentList.cpp')
-rw-r--r-- | lib/AST/RawCommentList.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/RawCommentList.cpp b/lib/AST/RawCommentList.cpp index b2b0c43aed..e7b86dffb2 100644 --- a/lib/AST/RawCommentList.cpp +++ b/lib/AST/RawCommentList.cpp @@ -130,7 +130,7 @@ StringRef RawComment::getRawTextSlow(const SourceManager &SourceMgr) const { return StringRef(BufferStart + BeginOffset, Length); } -StringRef RawComment::extractBriefText(const ASTContext &Context) const { +const char *RawComment::extractBriefText(const ASTContext &Context) const { // Make sure that RawText is valid. getRawText(Context.getSourceManager()); @@ -142,10 +142,10 @@ StringRef RawComment::extractBriefText(const ASTContext &Context) const { const unsigned BriefTextLength = Result.size(); char *BriefTextPtr = new (Context) char[BriefTextLength + 1]; memcpy(BriefTextPtr, Result.c_str(), BriefTextLength + 1); - BriefText = StringRef(BriefTextPtr, BriefTextLength); + BriefText = BriefTextPtr; BriefTextValid = true; - return BriefText; + return BriefTextPtr; } namespace { |