From 9c8a6f5a8eb3a0a4797b470701ff39a5775c23c4 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 11 Feb 2010 22:44:22 +0000 Subject: Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext. llvm-svn: 95931 --- clang/lib/AST/AttrImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang') diff --git a/clang/lib/AST/AttrImpl.cpp b/clang/lib/AST/AttrImpl.cpp index d13d4b326c3..d81979734b3 100644 --- a/clang/lib/AST/AttrImpl.cpp +++ b/clang/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); -- cgit v1.2.3