From daa786d4730b03a647700c2ccd1c93ea5d6bc76c Mon Sep 17 00:00:00 2001 From: Evan Mezeske Date: Mon, 27 Jan 2025 11:34:44 -0700 Subject: [PATCH] Remove noexcept from UserPanicHandler::call() so that panic handlers can throw. Without this change, throwing inside the user panic handler calls terminate(). Note that the docs for setPanicHandler() explicitly say that it's okay for the handler to throw, which is not true prior to this change. --- libs/utils/src/Panic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/utils/src/Panic.cpp b/libs/utils/src/Panic.cpp index 1b8921ac068b..e0aec064faa1 100644 --- a/libs/utils/src/Panic.cpp +++ b/libs/utils/src/Panic.cpp @@ -43,7 +43,7 @@ class UserPanicHandler { struct CallBack { Panic::PanicHandlerCallback handler = nullptr; void* user = nullptr; - void call(Panic const& panic) const noexcept { + void call(Panic const& panic) const { if (UTILS_UNLIKELY(handler)) { handler(user, panic); } @@ -64,7 +64,7 @@ class UserPanicHandler { return data; } - void call(Panic const& panic) const noexcept { + void call(Panic const& panic) const { getCallback().call(panic); }