]> granicus.if.org Git - clang/commitdiff
Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated...
authorTed Kremenek <kremenek@apple.com>
Thu, 11 Feb 2010 22:44:22 +0000 (22:44 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 11 Feb 2010 22:44:22 +0000 (22:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95931 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/AttrImpl.cpp

index d13d4b326c33173a3dbb877c696b93715b2b68bf..d81979734b3af5f58dc5e8b1594dd719b6b005c4 100644 (file)
@@ -40,7 +40,7 @@ void AttrWithString::Destroy(ASTContext &C) {
 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);