Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove noexcept from UserPanicHandler::call() so that panic handlers can throw as documented #8390

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

emezeske
Copy link
Contributor

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:

     * Sets a user-defined handler for the Panic. If exceptions are enabled, the concrete Panic
     * object will be thrown upon return; moreover it is acceptable to throw from the provided
     * callback, but it is unsafe to throw the Panic object itself, since it's just an interface.
     * It is also acceptable to abort from the callback. If exceptions are not enabled, std::abort()
     * will be automatically called upon return.

@emezeske
Copy link
Contributor Author

(See also #8197)

@pixelflinger pixelflinger added the internal Issue/PR does not affect clients label Jan 28, 2025
@pixelflinger pixelflinger requested a review from bejado January 28, 2025 05:18
…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.
@pixelflinger pixelflinger merged commit 4465e6c into google:main Jan 29, 2025
1 check passed
@emezeske
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants