[libcxxabi] r346607 - Port LLVM r346606 to libcxxabi.

Nico Weber nicolasweber at gmx.de
Sun Nov 11 02:09:06 PST 2018


Author: nico
Date: Sun Nov 11 02:09:06 2018
New Revision: 346607

URL: http://llvm.org/viewvc/llvm-project?rev=346607&view=rev
Log:
Port LLVM r346606 to libcxxabi.

Modified:
    libcxxabi/trunk/src/cxa_demangle.cpp
    libcxxabi/trunk/src/demangle/Utility.h

Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=346607&r1=346606&r2=346607&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Sun Nov 11 02:09:06 2018
@@ -352,7 +352,7 @@ __cxa_demangle(const char *MangledName,
 
   if (AST == nullptr)
     InternalStatus = demangle_invalid_mangled_name;
-  else if (initializeOutputStream(Buf, N, S, 1024))
+  else if (!initializeOutputStream(Buf, N, S, 1024))
     InternalStatus = demangle_memory_alloc_failure;
   else {
     assert(Parser.ForwardTemplateRefs.empty());

Modified: libcxxabi/trunk/src/demangle/Utility.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/demangle/Utility.h?rev=346607&r1=346606&r2=346607&view=diff
==============================================================================
--- libcxxabi/trunk/src/demangle/Utility.h (original)
+++ libcxxabi/trunk/src/demangle/Utility.h Sun Nov 11 02:09:06 2018
@@ -176,13 +176,13 @@ inline bool initializeOutputStream(char
   if (Buf == nullptr) {
     Buf = static_cast<char *>(std::malloc(InitSize));
     if (Buf == nullptr)
-      return true;
+      return false;
     BufferSize = InitSize;
   } else
     BufferSize = *N;
 
   S.reset(Buf, BufferSize);
-  return false;
+  return true;
 }
 
 } // namespace




More information about the libcxx-commits mailing list