Re: "finally" handling refactoring (Bug #72213)
| From: | Nikita Popov | Date: | Fri, 20 May 2016 13:54:07 +0000 |
| Subject: | Re: "finally" handling refactoring (Bug #72213) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93418@lists.php.net to get a copy of this message | ||
On Fri, May 20, 2016 at 2:07 PM, Dmitry Stogov <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