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);


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to