diff options
author | Daniel Jasper <djasper@google.com> | 2015-03-05 23:17:32 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-03-05 23:17:32 +0000 |
commit | 08201e394e62575a5b551b707d64ee9576ba89b7 (patch) | |
tree | e1624557afaeeea2f3d404c4dea52afbb6475c65 /clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp | |
parent | 12ba733ce8ec0dc51d6353999c43bd30c6221091 (diff) | |
download | bcm5719-llvm-08201e394e62575a5b551b707d64ee9576ba89b7.tar.gz bcm5719-llvm-08201e394e62575a5b551b707d64ee9576ba89b7.zip |
Use std::string instead of StringRef to prevent use-after-free.
Discovered by asan.
llvm-svn: 231421
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp index 61c7b36a06e..7264f49e8bd 100644 --- a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp @@ -83,7 +83,7 @@ void NamespaceCommentCheck::check(const MatchFinder::MatchResult &Result) { bool NeedLineBreak = NextTokenIsOnSameLine && Tok.isNot(tok::eof); SourceRange OldCommentRange(AfterRBrace, AfterRBrace); - StringRef Message = "%0 not terminated with a closing comment"; + std::string Message = "%0 not terminated with a closing comment"; // Try to find existing namespace closing comment on the same line. if (Tok.is(tok::comment) && NextTokenIsOnSameLine) { |