[llvm] r216428 - Revert "Support/Path: remove raw delete"

Dylan Noblesmith nobled at dreamwidth.org
Mon Aug 25 19:03:31 PDT 2014


Author: nobled
Date: Mon Aug 25 21:03:30 2014
New Revision: 216428

URL: http://llvm.org/viewvc/llvm-project?rev=216428&view=rev
Log:
Revert "Support/Path: remove raw delete"

This reverts commit r216360.

Modified:
    llvm/trunk/lib/Support/Path.cpp

Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=216428&r1=216427&r2=216428&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Mon Aug 25 21:03:30 2014
@@ -881,8 +881,7 @@ std::error_code copy_file(const Twine &F
   }
 
   const size_t BufSize = 4096;
-  std::vector<char> Buffer(BufSize);
-  char *Buf = Buffer.data();
+  char *Buf = new char[BufSize];
   int BytesRead = 0, BytesWritten = 0;
   for (;;) {
     BytesRead = read(ReadFD, Buf, BufSize);
@@ -899,6 +898,7 @@ std::error_code copy_file(const Twine &F
   }
   close(ReadFD);
   close(WriteFD);
+  delete[] Buf;
 
   if (BytesRead < 0 || BytesWritten < 0)
     return std::error_code(errno, std::generic_category());





More information about the llvm-commits mailing list