0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-31 19:08:59 +01:00

ircd::util: Better to return the input symbol rather than throwing not_mangled.

This commit is contained in:
Jason Volk 2018-06-11 00:26:20 -07:00
parent 5c919d5503
commit 6236cf230f

View file

@ -72,10 +72,20 @@ ircd::util::demangle(const mutable_buffer &out,
"Demangle failed -1: memory allocation failure" "Demangle failed -1: memory allocation failure"
}; };
/*
case -2: throw not_mangled case -2: throw not_mangled
{ {
"Demangle failed -2: mangled name '%s' is not valid", symbol "Demangle failed -2: mangled name '%s' is not valid", symbol
}; };
*/
// No real use case within IRCd for throwing not_mangled which may
// happen for extern "C" related; instead simply copying the input
// to the output (as per expectation) is much better behavior.
case -2: return string_view
{
symbol, strlcpy(out, symbol)
};
case -3: throw demangle_error case -3: throw demangle_error
{ {