From: Ted Kremenek Date: Thu, 11 Feb 2010 22:44:22 +0000 (+0000) Subject: Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2f769b5c20e7e26ba1f76612ac524853fd095c6;p=clang Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95931 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/AttrImpl.cpp b/lib/AST/AttrImpl.cpp index d13d4b326c..d81979734b 100644 --- a/lib/AST/AttrImpl.cpp +++ b/lib/AST/AttrImpl.cpp @@ -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(Str)); - Str = new char[newS.size()]; + Str = new (C) char[newS.size()]; } StrLen = newS.size(); memcpy(const_cast(Str), newS.data(), StrLen);