[cfe-commits] r95931 - /cfe/trunk/lib/AST/AttrImpl.cpp

Ted Kremenek kremenek at apple.com
Thu Feb 11 14:44:22 PST 2010


Author: kremenek
Date: Thu Feb 11 16:44:22 2010
New Revision: 95931

URL: http://llvm.org/viewvc/llvm-project?rev=95931&view=rev
Log:
Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext.

Modified:
    cfe/trunk/lib/AST/AttrImpl.cpp

Modified: cfe/trunk/lib/AST/AttrImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/AttrImpl.cpp?rev=95931&r1=95930&r2=95931&view=diff

==============================================================================
--- cfe/trunk/lib/AST/AttrImpl.cpp (original)
+++ cfe/trunk/lib/AST/AttrImpl.cpp Thu Feb 11 16:44:22 2010
@@ -40,7 +40,7 @@
 void AttrWithString::ReplaceString(ASTContext &C, llvm::StringRef newS) {
   if (newS.size() > StrLen) {
     C.Deallocate(const_cast<char*>(Str));
-    Str = new char[newS.size()];
+    Str = new (C) char[newS.size()];
   }
   StrLen = newS.size();
   memcpy(const_cast<char*>(Str), newS.data(), StrLen);





More information about the cfe-commits mailing list