Quellcode durchsuchen

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
Ted Kremenek vor 15 Jahren
Ursprung
Commit
e2f769b5c2
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      lib/AST/AttrImpl.cpp

+ 1 - 1
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);