0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd::ctx: Assert no yielding during exception handling due to ABI limitations.

This commit is contained in:
Jason Volk 2018-03-24 15:53:15 -07:00
parent 1e99077169
commit 7dbfb061e9

View file

@ -518,6 +518,14 @@ ircd::ctx::continuation::continuation(ctx *const &self)
assert(!critical_asserted);
assert(self != nullptr);
assert(self->notes <= 1);
// GNU cxxabi uses a singly-linked forward list (aka the 'exception
// stack') for pending exception activities. Due to this limitation we
// cannot interleave _cxa_begin_catch() and __cxa_end_catch() by yielding
// the ircd::ctx in an exception handler.
assert(!std::uncaught_exceptions());
assert(!std::current_exception());
self->cont = this;
ircd::ctx::current = nullptr;
}