wez Sat Sep 10 13:47:22 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src/ext/standard var.c
Log:
allow exceptions thrown in __sleep to interrupt the serialization process.
refs PECL #5217
http://cvs.php.net/diff.php/php-src/ext/standard/var.c?r1=1.203&r2=1.203.2.1&ty=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.203 php-src/ext/standard/var.c:1.203.2.1
--- php-src/ext/standard/var.c:1.203 Wed Aug 3 10:08:15 2005
+++ php-src/ext/standard/var.c Sat Sep 10 13:47:20 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.203 2005/08/03 14:08:15 sniper Exp $ */
+/* $Id: var.c,v 1.203.2.1 2005/09/10 17:47:20 wez Exp $ */
@@ -711,13 +711,20 @@
}
if (ce && ce != PHP_IC_ENTRY &&
- zend_hash_exists(&ce->function_table,
"__sleep", sizeof("__sleep"))) {
+
zend_hash_exists(&ce->function_table, "__sleep", sizeof("__sleep"))) {
INIT_PZVAL(&fname);
ZVAL_STRINGL(&fname, "__sleep",
sizeof("__sleep") - 1, 0);
res =
call_user_function_ex(CG(function_table), struc, &fname,
&retval_ptr, 0, 0, 1, NULL TSRMLS_CC);
if (res == SUCCESS) {
+ if (EG(exception)) {
+ /* allow exceptions to
bubble up */
+ if (retval_ptr) {
+
zval_ptr_dtor(&retval_ptr);
+ }
+ return;
+ }
if (retval_ptr) {
if
(HASH_OF(retval_ptr)) {
php_var_serialize_class(buf, struc, retval_ptr,
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php