Date: Sat, 25 Mar 2017 12:29:15 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315943 - in stable: 10/contrib/libcxxrt 11/contrib/libcxxrt 9/contrib/libcxxrt Message-ID: <201703251229.v2PCTF5I075791@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <theraven@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)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703251229.v2PCTF5I075791>