-
Couldn't load subscription status.
- Fork 45
Add Try/Catch support. Not fully formed yet #102
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
Conversation
…ly traverse try/catch edges as they aren't returned in the sub-node call
… color Catches to type to make it clearer and easier to follow
Clean up try/catch support, changing `Op::getSubBlock()` logic to return an associative array of variable => value instead of variable-variables.
|
@eric-therond I merged in your changes. Thanks a ton for that so far. I tried testing with a more aggressive and convoluted flow. I turned of It's generating what looks on the surface to be the correct text dump: And the CFG diagram generated looks solid too (though it is non-obvious since jumps aren't labeled)
And with the optimzier turned on (Traverser enabled):
So overall this looks good to me so far. Anything else missing at this point? |
|
Thank you for all your advice and for moving this project forward.
From what you suggested here on another thread, I think this is still missing, I can try to add it later. |
|
I created a pull request on parents, I would say it is actually enough if:
? |
|
Forget my previous message. I now understand that in the event of an exception that can occur anywhere, it may be desirable to add an edge from any block in the try body to the catch/finally blocks? I've fixed the PR in this direction. |
Rewire parents to track them properly across nested try/catch blocks
|
Anything else missing here? Is this ready to merge? |
|
Yes it looks ok for me. |
|
Really well done here, thanks for the back and forth, the polish, and driving it to completion! |
|
Thank to you! It's a very interesting project to work on. |



This adds support for try/catch. Though it is not complete.
Presently, Traverser doesn't fully implement correctly, as it won't traverse the CatchTarget property on the block. This will need to be fixed before merge.