summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/AttrImpl.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-11 22:44:22 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-11 22:44:22 +0000
commit9c8a6f5a8eb3a0a4797b470701ff39a5775c23c4 (patch)
tree0844bb06f3aa831a065c837739e07539116c24e2 /clang/lib/AST/AttrImpl.cpp
parent2c809308ca66533e05dbbf66caa0e3fd1c7bde39 (diff)
downloadbcm5719-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.cpp2
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);
OpenPOWER on IntegriCloud