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

Make exit() unwind properly (minimal version) #5768

Open
wants to merge 1 commit into
base: master
from

Conversation

@nikic
Copy link
Member

nikic commented Jun 25, 2020

This is a minimal version of #5243. It switches exit() to throw an internal exception that is invisible to the user and only used to unwind the stack properly and perform a clean shutdown.

It does not execute finally block for exits, and leaves that issue for the future.

@CharlotteDunois
Copy link

CharlotteDunois commented Jun 25, 2020

Thank you, I'm all in for an internal exception with no userland behaviour change.

@morrisonlevi
Copy link
Contributor

morrisonlevi commented Jun 25, 2020

When control returns to an internal function, will EG(exception) still be set? I'm really after this: will generic error handling code for internal functions work or break or..?

@nikic
Copy link
Member Author

nikic commented Jun 25, 2020

When control returns to an internal function, will EG(exception) still be set? I'm really after this: will generic error handling code for internal functions work or break or..?

Yes, it will be set. Internal functions will work correctly if they handle exceptions correctly (e.g., don't throw warnings if an exception has been thrown).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.