Skip to content

Extend error control operator to suppress exceptions #6757

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

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Mar 6, 2021

Proof of concept PR for the "Extend error control operator to suppress exceptions" RFC which can currently be found on GitHub.

Features:

  • @ operator now will also suppress instances of Exception (not Throwable) thrown by the expression it prefixes.
  • New @<class_union_list> syntax which suppress instances of classes in the union list (can be an instances of Error), without suppressing diagnostics.

Issues to fix:

  • Memory leaks for function arguments
  • Memory leak when instantiating an object where the constructor throws
  • Various assertion failure
  • Opcache review
  • Test fixes

Considerations:

  • Not generating backtraces when exception will be suppressed (new live range kind?)
  • Should internal functions be able to return something other than false|null for BC considerations.

This introduces "virtual" try-catch blocks by inserting CATCH opcodes after the END_SILENCE opcode

@Girgias Girgias added the RFC label Mar 6, 2021
@Girgias Girgias force-pushed the error-silence-exception-adding-try-catch-opcodes branch from fdc8a29 to c1da0b5 Compare April 1, 2021 14:26
@Girgias Girgias force-pushed the error-silence-exception-adding-try-catch-opcodes branch from c1da0b5 to b639017 Compare April 26, 2021 14:24
@Girgias Girgias force-pushed the error-silence-exception-adding-try-catch-opcodes branch from b639017 to e39218f Compare September 22, 2021 01:01
@iluuu1994
Copy link
Member

@Girgias Has this gone stale? Will you continue working on this or can this PR be closed?

@Girgias
Copy link
Member Author

Girgias commented Apr 20, 2022

@Girgias Has this gone stale? Will you continue working on this or can this PR be closed?

I'm not sure I'll be able to work on this for this release cycle, but it is still in the back of my mind. :)

@iluuu1994
Copy link
Member

@Girgias No problem, this can stay open. We're just trying to close anything that has no chance of going anywhere.

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

Successfully merging this pull request may close these issues.

3 participants