aboutsummaryrefslogtreecommitdiff
path: root/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
commite2f769b5c20e7e26ba1f76612ac524853fd095c6 (patch)
treede67786f7cc79d215440aeb1d0a373cdb13d0f8f /lib/AST/AttrImpl.cpp
parenteb3b324800598cc3d5385fbad95ae5cff2c79113 (diff)
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
Diffstat (limited to 'lib/AST/AttrImpl.cpp')
-rw-r--r--lib/AST/AttrImpl.cpp2
1 files changed, 1 insertions, 1 deletions
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<char*>(Str));
- Str = new char[newS.size()];
+ Str = new (C) char[newS.size()];
}
StrLen = newS.size();
memcpy(const_cast<char*>(Str), newS.data(), StrLen);