forked from OSchip/llvm-project
Use std::string instead of StringRef to prevent use-after-free.
Discovered by asan. llvm-svn: 231421
This commit is contained in:
parent
12ba733ce8
commit
08201e394e
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue