[llvm] r306780 - Change the type of Undecorated to unique_ptr<char[]> since we're looking at a null terminated string and not a single character.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 18:45:56 PDT 2017


Author: echristo
Date: Thu Jun 29 18:45:56 2017
New Revision: 306780

URL: http://llvm.org/viewvc/llvm-project?rev=306780&view=rev
Log:
Change the type of Undecorated to unique_ptr<char[]> since we're looking at a null terminated string and not a single character.

Fixes an error in tcmalloc sized delete checking.

Modified:
    llvm/trunk/tools/llvm-nm/llvm-nm.cpp

Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=306780&r1=306779&r2=306780&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Thu Jun 29 18:45:56 2017
@@ -672,7 +672,7 @@ static Optional<std::string> demangle(St
     return None;
 
   int Status;
-  std::unique_ptr<char> Undecorated(
+  std::unique_ptr<char[]> Undecorated(
       itaniumDemangle(Name.str().c_str(), nullptr, nullptr, &Status));
   if (Status != 0)
     return None;




More information about the llvm-commits mailing list