From ab2534653426868a7bcbf3475e25e937e4bdb673 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 9 Jul 2019 01:26:37 -0700 Subject: [PATCH] ircd::ctx: Tweak exception_handler. --- ircd/ctx.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ircd/ctx.cc b/ircd/ctx.cc index 0c21295c2..e3570f643 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -780,13 +780,14 @@ noexcept assert(bool(*this)); #ifdef HAVE_CXXABI_H - __cxxabiv1::__cxa_end_catch(); + if(current) + __cxxabiv1::__cxa_end_catch(); #endif // We don't yet support more levels of exceptions; after ending this // catch we can't still be in another one. This doesn't apply if we're // not on any ctx currently. - assert(!current || !std::current_exception()); + assert(!current || !std::uncaught_exceptions()); } //