Fix crash when demangled symbol is n/a
std::string foo (NULL) can throw a std::__throw_logic_error which was not caught.
This commit is contained in:
parent
572a69758a
commit
c5e5659022
@ -27,16 +27,15 @@ std::string
|
||||
PBD::demangle_symbol (const std::string& mangled_symbol)
|
||||
{
|
||||
#if defined(__GLIBCXX__)
|
||||
int status;
|
||||
|
||||
try {
|
||||
|
||||
int status;
|
||||
char* realname = abi::__cxa_demangle (mangled_symbol.c_str(), 0, 0, &status);
|
||||
std::string demangled_symbol (realname);
|
||||
free (realname);
|
||||
return demangled_symbol;
|
||||
} catch (const std::exception&) {
|
||||
|
||||
} catch (...) {
|
||||
/* may happen if realname == NULL */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user