Re: "finally" handling refactoring (Bug #72213)
| From: | Dmitry Stogov | Date: | Mon, 23 May 2016 11:25:14 +0000 |
| Subject: | Re: "finally" handling refactoring (Bug #72213) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93443@lists.php.net to get a copy of this message | ||
Thanks for review.
Both problems should be fixed now https://gist.github.com/dstogov/0a809891c6a3ac3fac4bd0d9711dd330
Do you see any other problems or a better way to fix this?
Thanks. Dmitry.
________________________________
From: Nikita Popov <nikita.ppv@gmail.com>
Sent: Friday, May 20, 2016 4:54:07 PM
To: Dmitry Stogov
Cc: Xinchen Hui; internals
Subject: Re: "finally" handling refactoring (Bug #72213)
On Fri, May 20, 2016 at 2:07 PM, Dmitry Stogov <dmitry@zend.com<mailto:dmitry@zend.com>> wrote:
hi,
Please review the path https://gist.github.com/dstogov/0a809891c6a3ac3fac4bd0d9711dd330
I hope, it should completely fix https://bugs.php.net/bug.php?id=72213
I'm going to commit this on Monday.
Thanks. Dmitry.
From a quick look:
https://gist.github.com/dstogov/0a809891c6a3ac3fac4bd0d9711dd330#file-bug72213-diff-L74
=> should this be orig_try_catch_offset?
https://gist.github.com/dstogov/0a809891c6a3ac3fac4bd0d9711dd330#file-bug72213-diff-L303
=> This assumes that either there's a catch block or a finally block to go to. However, if
we're in the catch block of a try/catch (without finally) that may not be true.
Also, this still leaks one exception :(
<?php
function test() {
try {
throw new Exception(1);
} finally {
try {
throw new Exception(2);
} finally {
return 42;
}
}
}
test();
Nikita