[PR][php-src][#1089][master] - zend_call_function should consider exception a failure.
| From: | noreply@php.net | Date: | Mon, 16 Feb 2015 17:37:13 +0000 |
| Subject: | [PR][php-src][#1089][master] - zend_call_function should consider exception a failure. | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-2347@lists.php.net to get a copy of this message | ||
You can view the Pull Request on github:
https://github.com/php/php-src/pull/1089
Pull Request Description:
If a function has thrown an exception, it has not been called successfully and shouldn't return
SUCCESS. This was found to be an issue in https://bugs.php.net/bug.php?id=68760
The scenario is:
i) Setup a callback function to be used by an external library, in this case SQLite.
ii) Call a userland function through that callback.
iii) The userland function throws an exception.
When the callback function throws an exception, the sorting should stop immediately rather than on
the next loop. Currently it is not possible for the calling code to detect that the function has
failed due to it throwing an exception, as zend_call_function returns SUCCESS on the function call
that threw the exception, instead it is subsequent calls to the callback function that return
FAILURE.
This change allows immediate detection that the callback has failed, within the loop that has
failed, rather than the next one.
This change should only be done for 7.
fyi The place where the callback is being called is here:
https://github.com/php/php-src/blob/master/ext/sqlite3/sqlite3.c#L746-L748