]> granicus.if.org Git - clang/commitdiff
Remove unnecessary StringRef->char*->StringRef conversion, which read uninitialized...
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 22 Apr 2012 20:43:30 +0000 (20:43 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 22 Apr 2012 20:43:30 +0000 (20:43 +0000)
Found by valgrind.

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

lib/Parse/ParseDeclCXX.cpp

index c391782dca2f60b02e1752b6733bf129144c7494..771388fd606ab1b56d55ab75e191d269123be800 100644 (file)
@@ -2847,7 +2847,7 @@ IdentifierInfo *Parser::TryParseCXX11AttributeIdentifier(SourceLocation &Loc) {
     StringRef Spelling = PP.getSpelling(Tok.getLocation(), SpellingBuf);
     if (std::isalpha(Spelling[0])) {
       Loc = ConsumeToken();
-      return &PP.getIdentifierTable().get(Spelling.data());
+      return &PP.getIdentifierTable().get(Spelling);
     }
     return 0;
   }