diff options
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); |