diff options
author | Anchor Linden <anchor@lindenlab.com> | 2018-09-17 10:50:08 -0700 |
---|---|---|
committer | Anchor Linden <anchor@lindenlab.com> | 2018-09-17 10:50:08 -0700 |
commit | e5aeaa659a453674ef898cdd2ad6183d5eb77e41 (patch) | |
tree | 2c7196f2f80d11b6f6d660c5852299646f2d449a /indra/llcommon/llerror.cpp | |
parent | 7318bd61f7a7ea89e471a6e0f3cc310786a3b41c (diff) | |
parent | 6f54add8a8852c8f3df86abebe38ef0ce4a6742c (diff) |
Merge
Diffstat (limited to 'indra/llcommon/llerror.cpp')
-rw-r--r-- | indra/llcommon/llerror.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index f31a054139..29de79dc64 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -249,23 +249,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 |