From 6236cf230fab93ca56aeeafc37bb17816d70e47a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 11 Jun 2018 00:26:20 -0700 Subject: [PATCH] ircd::util: Better to return the input symbol rather than throwing not_mangled. --- ircd/demangle.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ircd/demangle.cc b/ircd/demangle.cc index 3189f1258..3053d78b6 100644 --- a/ircd/demangle.cc +++ b/ircd/demangle.cc @@ -72,10 +72,20 @@ ircd::util::demangle(const mutable_buffer &out, "Demangle failed -1: memory allocation failure" }; + /* case -2: throw not_mangled { "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 {