summaryrefslogtreecommitdiff
path: root/indra/llcommon/llerror.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-08-02 21:54:09 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-08-02 21:54:09 +0100
commit6ce09ad712f98fe5d0097f1de6a5d1793f5f2bdd (patch)
tree0d4ca8e3d55647d713447b0d865c75565e6458cf /indra/llcommon/llerror.cpp
parentac889b1eeb7f9a00e7a6d1d9ba14c70d0c7a33fc (diff)
parent09f97172bb478a2c977d8b7b0958196e7e98c433 (diff)
merge
Diffstat (limited to 'indra/llcommon/llerror.cpp')
-rw-r--r--indra/llcommon/llerror.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index d0e7c06f36..ba71f4ddfb 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -250,23 +250,13 @@ namespace LLError
{
#ifdef __GNUC__
// GCC: type_info::name() returns a mangled class name,st demangle
-
- static size_t abi_name_len = 100;
- static char* abi_name_buf = (char*)malloc(abi_name_len);
- // warning: above is voodoo inferred from the GCC manual,
- // do NOT change
-
- int status;
- // We don't use status, and shouldn't have to pass apointer to it
- // but gcc 3.3 libstc++'s implementation of demangling is broken
- // and fails without.
-
- char* name = abi::__cxa_demangle(mangled,
- abi_name_buf, &abi_name_len, &status);
- // this call can realloc the abi_name_buf pointer (!)
-
- return name ? name : mangled;
-
+ // passing nullptr, 0 forces allocation of a unique buffer we can free
+ // fixing MAINT-8724 on OSX 10.14
+ int status = -1;
+ char* name = abi::__cxa_demangle(mangled, nullptr, 0, &status);
+ std::string result(name ? name : mangled);
+ free(name);
+ return result;
#elif LL_WINDOWS
// DevStudio: type_info::name() includes the text "class " at the start