Author: dim
Date: Sat Mar 25 12:29:15 2017
New Revision: 315943
URL: https://svnweb.freebsd.org/changeset/base/315943

Log:
  MFC r315745:
  
  Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:
  
  Author: David Chisnall <thera...@freebsd.org>
  Date:   Wed Mar 22 12:27:08 2017 +0000
  
      Simplify some code.
  
      realloc() with a null pointer is equivalent to malloc, so we don't need
      to handle the two cases independently.
  
      Fixes #46
  
  This should help with lang/beignet and other programs, which expect
  __cxa_demangle(name, NULL, NULL, &status) to return zero in status.
  
  PR:           213732

Modified:
  stable/11/contrib/libcxxrt/typeinfo.cc
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/contrib/libcxxrt/typeinfo.cc
  stable/9/contrib/libcxxrt/typeinfo.cc
Directory Properties:
  stable/10/   (props changed)
  stable/9/   (props changed)
  stable/9/contrib/   (props changed)
  stable/9/contrib/libcxxrt/   (props changed)

Modified: stable/11/contrib/libcxxrt/typeinfo.cc
==============================================================================
--- stable/11/contrib/libcxxrt/typeinfo.cc      Sat Mar 25 12:21:20 2017        
(r315942)
+++ stable/11/contrib/libcxxrt/typeinfo.cc      Sat Mar 25 12:29:15 2017        
(r315943)
@@ -86,15 +86,7 @@ extern "C" char* __cxa_demangle(const ch
        if (NULL != demangled)
        {
                size_t len = strlen(demangled);
-               if (buf == NULL)
-               {
-                       if (n)
-                       {
-                               *n = len;
-                       }
-                       return demangled;
-               }
-               if (*n < len+1)
+               if (!buf || (*n < len+1))
                {
                        buf = static_cast<char*>(realloc(buf, len+1));
                }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to