diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-02-11 22:44:22 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-02-11 22:44:22 +0000 |
commit | 9c8a6f5a8eb3a0a4797b470701ff39a5775c23c4 (patch) | |
tree | 0844bb06f3aa831a065c837739e07539116c24e2 /clang/lib/AST/AttrImpl.cpp | |
parent | 2c809308ca66533e05dbbf66caa0e3fd1c7bde39 (diff) | |
download | bcm5719-llvm-9c8a6f5a8eb3a0a4797b470701ff39a5775c23c4.tar.gz bcm5719-llvm-9c8a6f5a8eb3a0a4797b470701ff39a5775c23c4.zip |
Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext.
llvm-svn: 95931
Diffstat (limited to 'clang/lib/AST/AttrImpl.cpp')
-rw-r--r-- | clang/lib/AST/AttrImpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<char*>(Str)); - Str = new char[newS.size()]; + Str = new (C) char[newS.size()]; } StrLen = newS.size(); memcpy(const_cast<char*>(Str), newS.data(), StrLen); |