colder Wed Nov 19 02:00:57 2008 UTC Added files: (Branch: PHP_5_3) /ZendEngine2/tests bug46241.phpt
Modified files: /php-src NEWS /ZendEngine2 zend_execute_API.c zend_vm_def.h zend_vm_execute.h /ZendEngine2/tests bug46196.phpt /php-src/ext/date php_date.c /php-src/ext/dom attr.c cdatasection.c comment.c document.c documentfragment.c element.c entityreference.c processinginstruction.c text.c xpath.c /php-src/ext/mysqli mysqli_driver.c /php-src/ext/simplexml simplexml.c /php-src/ext/spl spl_array.c spl_directory.c spl_iterators.c spl_observer.c /php-src/ext/sqlite sqlite.c /php-src/ext/sqlite3 sqlite3.c Log: MFH: Fix #46241 (stacked error_handlers, error_handling in general)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.381&r2=1.2027.2.547.2.965.2.382&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.381 php-src/NEWS:1.2027.2.547.2.965.2.382 --- php-src/NEWS:1.2027.2.547.2.965.2.381 Tue Nov 18 17:55:07 2008 +++ php-src/NEWS Wed Nov 19 02:00:49 2008 @@ -41,6 +41,8 @@ endian systems). (Scott) - Fixed bug #46285 (lastInsertId() returns "0" when a deferenced PDOStatement is executed). (Johannes) +- Fixed bug #46241 (stacked error handlers, error handling in genera). + (Etienne) - Fixed bug #46238 (Segmentation fault on static call with empty string method). (Felipe) - Fixed bug #46205 (Closure - Memory leaks when ReflectionException is thrown). http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.331.2.20.2.24.2.64&r2=1.331.2.20.2.24.2.65&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.64 ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.65 --- ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.64 Wed Nov 12 09:05:48 2008 +++ ZendEngine2/zend_execute_API.c Wed Nov 19 02:00:50 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.64 2008/11/12 09:05:48 tony2001 Exp $ */ +/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.65 2008/11/19 02:00:50 colder Exp $ */ #include <stdio.h> #include <signal.h> @@ -943,14 +943,11 @@ EG(opline_ptr) = original_opline_ptr; } else if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { int call_via_handler = (EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0; - zend_error_handling error_handling; - zend_save_error_handling(&error_handling TSRMLS_CC); ALLOC_INIT_ZVAL(*fci->retval_ptr_ptr); if (EX(function_state).function->common.scope) { EG(scope) = EX(function_state).function->common.scope; } ((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, (fci->object_pp?*fci->object_pp:NULL), 1 TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); /* We shouldn't fix bad extensions here, because it can break proper ones (Bug #34045) if (!EX(function_state).function->common.return_reference) @@ -971,10 +968,7 @@ /* Not sure what should be done here if it's a static method */ if (fci->object_pp) { - zend_error_handling error_handling; - zend_save_error_handling(&error_handling TSRMLS_CC); Z_OBJ_HT_PP(fci->object_pp)->call_method(EX(function_state).function->common.function_name, fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, *fci->object_pp, 1 TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); } else { zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); } http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.59.2.29.2.48.2.75&r2=1.59.2.29.2.48.2.76&diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.75 ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.76 --- ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.75 Tue Nov 11 21:11:24 2008 +++ ZendEngine2/zend_vm_def.h Wed Nov 19 02:00:50 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.59.2.29.2.48.2.75 2008/11/11 21:11:24 stas Exp $ */ +/* $Id: zend_vm_def.h,v 1.59.2.29.2.48.2.76 2008/11/19 02:00:50 colder Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -2270,7 +2270,6 @@ EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC); if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - zend_error_handling error_handling; ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr); EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference; @@ -2285,14 +2284,12 @@ arg_count--; } } - zend_save_error_handling(&error_handling TSRMLS_CC); if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(EXECUTE_DATA, RETURN_VALUE_USED(opline) TSRMLS_CC); } - zend_restore_error_handling(&error_handling TSRMLS_CC); if (!RETURN_VALUE_USED(opline)) { zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); @@ -2340,10 +2337,7 @@ /* Not sure what should be done here if it's a static method */ if (EX(object)) { - zend_error_handling error_handling; - zend_save_error_handling(&error_handling TSRMLS_CC); Z_OBJ_HT_P(EX(object))->call_method(EX(function_state).function->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); } else { zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); } http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.30.2.49.2.75&r2=1.62.2.30.2.49.2.76&diff_format=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.75 ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.76 --- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.75 Tue Nov 11 21:11:24 2008 +++ ZendEngine2/zend_vm_execute.h Wed Nov 19 02:00:50 2008 @@ -294,7 +294,6 @@ EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC); if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - zend_error_handling error_handling; ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr); EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference; @@ -309,14 +308,12 @@ arg_count--; } } - zend_save_error_handling(&error_handling TSRMLS_CC); if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(execute_data, RETURN_VALUE_USED(opline) TSRMLS_CC); } - zend_restore_error_handling(&error_handling TSRMLS_CC); if (!RETURN_VALUE_USED(opline)) { zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); @@ -364,10 +361,7 @@ /* Not sure what should be done here if it's a static method */ if (EX(object)) { - zend_error_handling error_handling; - zend_save_error_handling(&error_handling TSRMLS_CC); Z_OBJ_HT_P(EX(object))->call_method(EX(function_state).function->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); - zend_restore_error_handling(&error_handling TSRMLS_CC); } else { zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); } http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug46196.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/bug46196.phpt diff -u ZendEngine2/tests/bug46196.phpt:1.1.2.2 ZendEngine2/tests/bug46196.phpt:1.1.2.3 --- ZendEngine2/tests/bug46196.phpt:1.1.2.2 Sun Nov 2 20:15:46 2008 +++ ZendEngine2/tests/bug46196.phpt Wed Nov 19 02:00:53 2008 @@ -2,8 +2,6 @@ Test restore_error_handler() function : bug #46196 --CREDITS-- Olivier Doucet ---XFAIL-- -This test will fail until bug #46196 is fixed --FILE-- <?php /* Prototype : void restore_error_handler(void) http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.51.2.59&r2=1.43.2.45.2.51.2.60&diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.45.2.51.2.59 php-src/ext/date/php_date.c:1.43.2.45.2.51.2.60 --- php-src/ext/date/php_date.c:1.43.2.45.2.51.2.59 Mon Nov 17 11:27:53 2008 +++ php-src/ext/date/php_date.c Wed Nov 19 02:00:53 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.45.2.51.2.59 2008/11/17 11:27:53 felipe Exp $ */ +/* $Id: php_date.c,v 1.43.2.45.2.51.2.60 2008/11/19 02:00:53 colder Exp $ */ #include "php.h" #include "php_streams.h" @@ -2420,12 +2420,13 @@ zval *timezone_object = NULL; char *time_str = NULL; int time_str_len = 0; - + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) { date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC); } + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -3094,8 +3095,9 @@ int tz_len; timelib_tzinfo *tzi = NULL; php_timezone_obj *tzobj; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) { if (SUCCESS == timezone_initialize(&tzi, tz TSRMLS_CC)) { tzobj = zend_object_store_get_object(getThis() TSRMLS_CC); @@ -3106,6 +3108,7 @@ ZVAL_NULL(getThis()); } } + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -3437,8 +3440,9 @@ int interval_string_length; php_interval_obj *diobj; timelib_rel_time *reltime; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &interval_string, &interval_string_length) == SUCCESS) { if (date_interval_initialize(&reltime, interval_string, interval_string_length TSRMLS_CC) == SUCCESS) { diobj = zend_object_store_get_object(getThis() TSRMLS_CC); @@ -3448,6 +3452,7 @@ ZVAL_NULL(getThis()); } } + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -3590,12 +3595,14 @@ char *isostr = NULL; int isostr_len = 0; timelib_time *clone; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOl|l", &start, date_ce_date, &interval, date_ce_interval, &recurrences, &options) == FAILURE) { if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOO|l", &start, date_ce_date, &interval, date_ce_interval, &end, date_ce_date, &options) == FAILURE) { if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &isostr, &isostr_len, &options) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "This constructor accepts either (DateTime, DateInterval, int) OR (DateTime, DateInterval, DateTime) OR (string) as arguments."); + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } } @@ -3662,6 +3669,8 @@ dpobj->recurrences = recurrences + dpobj->include_start_date; dpobj->initialized = 1; + + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/dom/attr.c?r1=1.18.2.2.2.2.2.9&r2=1.18.2.2.2.2.2.10&diff_format=u Index: php-src/ext/dom/attr.c diff -u php-src/ext/dom/attr.c:1.18.2.2.2.2.2.9 php-src/ext/dom/attr.c:1.18.2.2.2.2.2.10 --- php-src/ext/dom/attr.c:1.18.2.2.2.2.2.9 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/attr.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: attr.c,v 1.18.2.2.2.2.2.9 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: attr.c,v 1.18.2.2.2.2.2.10 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -66,6 +66,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/cdatasection.c?r1=1.11.2.1.2.1.2.9&r2=1.11.2.1.2.1.2.10&diff_format=u Index: php-src/ext/dom/cdatasection.c diff -u php-src/ext/dom/cdatasection.c:1.11.2.1.2.1.2.9 php-src/ext/dom/cdatasection.c:1.11.2.1.2.1.2.10 --- php-src/ext/dom/cdatasection.c:1.11.2.1.2.1.2.9 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/cdatasection.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cdatasection.c,v 1.11.2.1.2.1.2.9 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: cdatasection.c,v 1.11.2.1.2.1.2.10 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -59,6 +59,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/comment.c?r1=1.11.2.1.2.1.2.9&r2=1.11.2.1.2.1.2.10&diff_format=u Index: php-src/ext/dom/comment.c diff -u php-src/ext/dom/comment.c:1.11.2.1.2.1.2.9 php-src/ext/dom/comment.c:1.11.2.1.2.1.2.10 --- php-src/ext/dom/comment.c:1.11.2.1.2.1.2.9 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/comment.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: comment.c,v 1.11.2.1.2.1.2.9 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: comment.c,v 1.11.2.1.2.1.2.10 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -59,6 +59,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/document.c?r1=1.68.2.3.2.5.2.11&r2=1.68.2.3.2.5.2.12&diff_format=u Index: php-src/ext/dom/document.c diff -u php-src/ext/dom/document.c:1.68.2.3.2.5.2.11 php-src/ext/dom/document.c:1.68.2.3.2.5.2.12 --- php-src/ext/dom/document.c:1.68.2.3.2.5.2.11 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/document.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: document.c,v 1.68.2.3.2.5.2.11 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: document.c,v 1.68.2.3.2.5.2.12 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1441,6 +1441,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/documentfragment.c?r1=1.15.2.1.2.1.2.9&r2=1.15.2.1.2.1.2.10&diff_format=u Index: php-src/ext/dom/documentfragment.c diff -u php-src/ext/dom/documentfragment.c:1.15.2.1.2.1.2.9 php-src/ext/dom/documentfragment.c:1.15.2.1.2.1.2.10 --- php-src/ext/dom/documentfragment.c:1.15.2.1.2.1.2.9 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/documentfragment.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: documentfragment.c,v 1.15.2.1.2.1.2.9 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: documentfragment.c,v 1.15.2.1.2.1.2.10 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -60,6 +60,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/element.c?r1=1.36.2.4.2.8.2.10&r2=1.36.2.4.2.8.2.11&diff_format=u Index: php-src/ext/dom/element.c diff -u php-src/ext/dom/element.c:1.36.2.4.2.8.2.10 php-src/ext/dom/element.c:1.36.2.4.2.8.2.11 --- php-src/ext/dom/element.c:1.36.2.4.2.8.2.10 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/element.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: element.c,v 1.36.2.4.2.8.2.10 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: element.c,v 1.36.2.4.2.8.2.11 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -166,6 +166,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } zend_restore_error_handling(&error_handling TSRMLS_CC); http://cvs.php.net/viewvc.cgi/php-src/ext/dom/entityreference.c?r1=1.12.2.1.2.2.2.8&r2=1.12.2.1.2.2.2.9&diff_format=u Index: php-src/ext/dom/entityreference.c diff -u php-src/ext/dom/entityreference.c:1.12.2.1.2.2.2.8 php-src/ext/dom/entityreference.c:1.12.2.1.2.2.2.9 --- php-src/ext/dom/entityreference.c:1.12.2.1.2.2.2.8 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/entityreference.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: entityreference.c,v 1.12.2.1.2.2.2.8 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: entityreference.c,v 1.12.2.1.2.2.2.9 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -58,6 +58,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/processinginstruction.c?r1=1.17.2.1.2.1.2.10&r2=1.17.2.1.2.1.2.11&diff_format=u Index: php-src/ext/dom/processinginstruction.c diff -u php-src/ext/dom/processinginstruction.c:1.17.2.1.2.1.2.10 php-src/ext/dom/processinginstruction.c:1.17.2.1.2.1.2.11 --- php-src/ext/dom/processinginstruction.c:1.17.2.1.2.1.2.10 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/processinginstruction.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: processinginstruction.c,v 1.17.2.1.2.1.2.10 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: processinginstruction.c,v 1.17.2.1.2.1.2.11 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -60,6 +60,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/text.c?r1=1.23.2.1.2.4.2.10&r2=1.23.2.1.2.4.2.11&diff_format=u Index: php-src/ext/dom/text.c diff -u php-src/ext/dom/text.c:1.23.2.1.2.4.2.10 php-src/ext/dom/text.c:1.23.2.1.2.4.2.11 --- php-src/ext/dom/text.c:1.23.2.1.2.4.2.10 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/text.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: text.c,v 1.23.2.1.2.4.2.10 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: text.c,v 1.23.2.1.2.4.2.11 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -74,6 +74,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/dom/xpath.c?r1=1.26.2.1.2.1.2.9&r2=1.26.2.1.2.1.2.10&diff_format=u Index: php-src/ext/dom/xpath.c diff -u php-src/ext/dom/xpath.c:1.26.2.1.2.1.2.9 php-src/ext/dom/xpath.c:1.26.2.1.2.1.2.10 --- php-src/ext/dom/xpath.c:1.26.2.1.2.1.2.9 Mon Nov 17 11:27:54 2008 +++ php-src/ext/dom/xpath.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xpath.c,v 1.26.2.1.2.1.2.9 2008/11/17 11:27:54 felipe Exp $ */ +/* $Id: xpath.c,v 1.26.2.1.2.1.2.10 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -277,6 +277,7 @@ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_driver.c?r1=1.4.2.3.2.2.2.5&r2=1.4.2.3.2.2.2.6&diff_format=u Index: php-src/ext/mysqli/mysqli_driver.c diff -u php-src/ext/mysqli/mysqli_driver.c:1.4.2.3.2.2.2.5 php-src/ext/mysqli/mysqli_driver.c:1.4.2.3.2.2.2.6 --- php-src/ext/mysqli/mysqli_driver.c:1.4.2.3.2.2.2.5 Fri Aug 8 22:07:07 2008 +++ php-src/ext/mysqli/mysqli_driver.c Wed Nov 19 02:00:53 2008 @@ -79,7 +79,7 @@ { MyG(report_mode) = Z_LVAL_P(value); /*FIXME*/ - zend_replace_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, NULL, NULL TSRMLS_CC); + /* zend_replace_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, NULL, NULL TSRMLS_CC); */ return SUCCESS; } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.35.2.27&r2=1.151.2.22.2.35.2.28&diff_format=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.27 php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.28 --- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.27 Mon Nov 17 11:27:58 2008 +++ php-src/ext/simplexml/simplexml.c Wed Nov 19 02:00:53 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simplexml.c,v 1.151.2.22.2.35.2.27 2008/11/17 11:27:58 felipe Exp $ */ +/* $Id: simplexml.c,v 1.151.2.22.2.35.2.28 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -2182,6 +2182,7 @@ zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbsb", &data, &data_len, &options, &is_url, &ns, &ns_len, &isprefix) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } @@ -2554,7 +2555,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.35.2.27 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.35.2.28 $"); php_info_print_table_row(2, "Schema support", #ifdef LIBXML_SCHEMAS_ENABLED "enabled"); http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.71.2.17.2.13.2.32&r2=1.71.2.17.2.13.2.33&diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.71.2.17.2.13.2.32 php-src/ext/spl/spl_array.c:1.71.2.17.2.13.2.33 --- php-src/ext/spl/spl_array.c:1.71.2.17.2.13.2.32 Mon Nov 17 11:27:59 2008 +++ php-src/ext/spl/spl_array.c Wed Nov 19 02:00:53 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_array.c,v 1.71.2.17.2.13.2.32 2008/11/17 11:27:59 felipe Exp $ */ +/* $Id: spl_array.c,v 1.71.2.17.2.13.2.33 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -1010,16 +1010,18 @@ zval **array; long ar_flags = 0; zend_class_entry *ce_get_iterator = spl_ce_Iterator; + zend_error_handling error_handling; if (ZEND_NUM_ARGS() == 0) { return; /* nothing to do */ } - zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|lC", &array, &ar_flags, &ce_get_iterator) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } @@ -1031,6 +1033,8 @@ spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1 TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); + } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.36&r2=1.45.2.27.2.23.2.37&diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.36 php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.37 --- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.36 Mon Nov 17 11:27:59 2008 +++ php-src/ext/spl/spl_directory.c Wed Nov 19 02:00:53 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.36 2008/11/17 11:27:59 felipe Exp $ */ +/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.37 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -373,6 +373,7 @@ { spl_filesystem_object *intern; zval *arg1; + zend_error_handling error_handling; if (!file_path || !file_path_len) { #if defined(PHP_WIN32) @@ -391,7 +392,7 @@ return NULL; } - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); ce = ce ? ce : source->info_class; return_value->value.obj = spl_filesystem_object_new_ex(ce, &intern TSRMLS_CC); @@ -406,6 +407,7 @@ spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy TSRMLS_CC); } + zend_restore_error_handling(&error_handling TSRMLS_CC); return intern; } /* }}} */ @@ -604,8 +606,9 @@ char *path; int parsed, len; long flags; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); if (ctor_flags & DIT_CTOR_FLAGS) { flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO; @@ -621,10 +624,12 @@ flags |= SPL_FILE_DIR_UNIXPATHS; } if (parsed == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } if (!len) { zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Directory name must not be empty."); + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } @@ -640,6 +645,7 @@ intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0; + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -914,16 +920,20 @@ spl_filesystem_object *intern; char *path; int len; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); spl_filesystem_info_set_filename(intern, path, len, 1 TSRMLS_CC); + + zend_restore_error_handling(&error_handling TSRMLS_CC); /* intern->type = SPL_FS_INFO; already set */ } @@ -934,10 +944,12 @@ SPL_METHOD(SplFileInfo, func_name) \ { \ spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); \ + zend_error_handling error_handling; \ \ - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC);\ + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);\ spl_filesystem_object_get_file_name(intern TSRMLS_CC); \ php_stat(intern->file_name, intern->file_name_len, func_num, return_value TSRMLS_CC); \ + zend_restore_error_handling(&error_handling TSRMLS_CC); \ } /* }}} */ @@ -1023,8 +1035,9 @@ spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); int ret; char buff[MAXPATHLEN]; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); #ifdef HAVE_SYMLINK ret = readlink(intern->file_name, buff, MAXPATHLEN-1); @@ -1041,6 +1054,8 @@ RETVAL_STRINGL(buff, ret, 1); } + + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -1052,8 +1067,9 @@ spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); char buff[MAXPATHLEN]; char *filename; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); if (intern->type == SPL_FS_DIR && !intern->file_name && intern->u.dir.entry.d_name[0]) { spl_filesystem_object_get_file_name(intern TSRMLS_CC); @@ -1076,6 +1092,8 @@ } else { RETVAL_FALSE; } + + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ #endif @@ -1096,12 +1114,15 @@ { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_class_entry *ce = spl_ce_SplFileObject; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { intern->file_class = ce; } + + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -1111,12 +1132,15 @@ { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_class_entry *ce = spl_ce_SplFileInfo; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { intern->info_class = ce; } + + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -1126,12 +1150,15 @@ { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_class_entry *ce = intern->info_class; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { spl_filesystem_object_create_type(ht, intern, SPL_FS_INFO, ce, return_value TSRMLS_CC); } + + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -1141,8 +1168,9 @@ { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_class_entry *ce = intern->info_class; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { int path_len; @@ -1151,6 +1179,8 @@ spl_filesystem_object_create_info(intern, path, path_len, 1, ce, return_value TSRMLS_CC); } } + + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -1940,8 +1970,9 @@ char *p1, *p2; char *tmp_path; int tmp_path_len; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); intern->u.file.open_mode = "r"; intern->u.file.open_mode_len = 1; @@ -1950,6 +1981,7 @@ &intern->file_name, &intern->file_name_len, &intern->u.file.open_mode, &intern->u.file.open_mode_len, &use_include_path, &intern->u.file.zcontext) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } @@ -1979,6 +2011,8 @@ intern->_path = estrndup(intern->u.file.stream->orig_path, intern->_path_len); } + zend_restore_error_handling(&error_handling TSRMLS_CC); + } /* }}} */ /* {{{ proto void SplTempFileObject::__construct([int max_memory]) @@ -1988,10 +2022,12 @@ long max_memory = PHP_STREAM_MAX_MEM; char tmp_fname[48]; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_memory) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } @@ -2013,6 +2049,7 @@ intern->_path_len = 0; intern->_path = estrndup("", 0); } + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ /* {{{ proto void SplFileObject::rewind() http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.28.2.19&r2=1.73.2.30.2.28.2.20&diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.19 php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.20 --- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.19 Mon Nov 17 11:27:59 2008 +++ php-src/ext/spl/spl_iterators.c Wed Nov 19 02:00:53 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_iterators.c,v 1.73.2.30.2.28.2.19 2008/11/17 11:27:59 felipe Exp $ */ +/* $Id: spl_iterators.c,v 1.73.2.30.2.28.2.20 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -424,8 +424,9 @@ zend_class_entry *ce_iterator; long mode, flags; int inc_refcount = 1; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); switch(rit_type) { case RIT_RecursiveTreeIterator: { @@ -481,6 +482,7 @@ zval_ptr_dtor(&iterator); } zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } @@ -530,6 +532,7 @@ intern->iterators[0].ce = ce_iterator; intern->iterators[0].state = RS_START; + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* {{{ proto void RecursiveIteratorIterator::__construct(RecursiveIterator|IteratorAggregate it [, int mode = RIT_LEAVES_ONLY [, int flags = 0]]) throws InvalidArgumentException @@ -1237,6 +1240,7 @@ spl_dual_it_object *intern; zend_class_entry *ce = NULL; int inc_refcount = 1; + zend_error_handling error_handling; intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); @@ -1245,7 +1249,7 @@ return NULL; } - zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); intern->dit_type = dit_type; switch (dit_type) { @@ -1253,14 +1257,17 @@ intern->u.limit.offset = 0; /* start at beginning */ intern->u.limit.count = -1; /* get all */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } if (intern->u.limit.offset < 0) { zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be > 0", 0 TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } if (intern->u.limit.count < 0 && intern->u.limit.count != -1) { zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } break; @@ -1269,10 +1276,12 @@ case DIT_RecursiveCachingIterator: { long flags = CIT_CALL_TOSTRING; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &zobject, ce_inner, &flags) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } if (spl_cit_check_flags(flags) != SUCCESS) { zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_CURRENT", 0 TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } intern->u.caching.flags |= flags & CIT_PUBLIC; @@ -1286,6 +1295,7 @@ int class_name_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|s", &zobject, ce_inner, &class_name, &class_name_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } ce = Z_OBJCE_P(zobject); @@ -1296,6 +1306,7 @@ || !(*pce_cast)->get_iterator ) { zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0 TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } ce = *pce_cast; @@ -1306,10 +1317,12 @@ if (retval) { zval_ptr_dtor(&retval); } + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } if (!retval || Z_TYPE_P(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE_P(retval), zend_ce_traversable TSRMLS_CC)) { zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "%s::getIterator() must return an object that implememnts Traversable", ce->name); + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } zobject = retval; @@ -1323,6 +1336,7 @@ spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 1 TSRMLS_CC); zend_call_method_with_0_params(&intern->u.append.zarrayit, spl_ce_ArrayIterator, &spl_ce_ArrayIterator->constructor, "__construct", NULL); intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, intern->u.append.zarrayit, 0 TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); return intern; #if HAVE_PCRE || HAVE_BUNDLED_PCRE case DIT_RegexIterator: @@ -1335,10 +1349,12 @@ intern->u.regex.flags = 0; intern->u.regex.preg_flags = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|lll", &zobject, ce_inner, ®ex, ®ex_len, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } if (mode < 0 || mode >= REGIT_MODE_MAX) { zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %ld", mode); + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } intern->u.regex.mode = mode; @@ -1346,6 +1362,7 @@ intern->u.regex.pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC); if (intern->u.regex.pce == NULL) { /* pcre_get_compiled_regex_cache has already sent error */ + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } intern->u.regex.pce->refcount++; @@ -1354,12 +1371,13 @@ #endif default: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobject, ce_inner) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } break; } - zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); if (inc_refcount) { Z_ADDREF_P(zobject); http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_observer.c?r1=1.2.2.6.2.3.2.12&r2=1.2.2.6.2.3.2.13&diff_format=u Index: php-src/ext/spl/spl_observer.c diff -u php-src/ext/spl/spl_observer.c:1.2.2.6.2.3.2.12 php-src/ext/spl/spl_observer.c:1.2.2.6.2.3.2.13 --- php-src/ext/spl/spl_observer.c:1.2.2.6.2.3.2.12 Mon Nov 17 11:27:59 2008 +++ php-src/ext/spl/spl_observer.c Wed Nov 19 02:00:53 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_observer.c,v 1.2.2.6.2.3.2.12 2008/11/17 11:27:59 felipe Exp $ */ +/* $Id: spl_observer.c,v 1.2.2.6.2.3.2.13 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -630,15 +630,18 @@ { spl_SplObjectStorage *intern; long flags = MIT_NEED_ALL|MIT_KEYS_NUMERIC; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); intern->flags = flags; + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.13.2.9.2.15&r2=1.166.2.13.2.9.2.16&diff_format=u Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.166.2.13.2.9.2.15 php-src/ext/sqlite/sqlite.c:1.166.2.13.2.9.2.16 --- php-src/ext/sqlite/sqlite.c:1.166.2.13.2.9.2.15 Mon Nov 17 11:27:59 2008 +++ php-src/ext/sqlite/sqlite.c Wed Nov 19 02:00:53 2008 @@ -17,7 +17,7 @@ | Marcus Boerger <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ - $Id: sqlite.c,v 1.166.2.13.2.9.2.15 2008/11/17 11:27:59 felipe Exp $ + $Id: sqlite.c,v 1.166.2.13.2.9.2.16 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H @@ -1454,7 +1454,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "SQLite support", "enabled"); - php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.9.2.15 2008/11/17 11:27:59 felipe Exp $"); + php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.9.2.16 2008/11/19 02:00:53 colder Exp $"); php_info_print_table_row(2, "SQLite Library", sqlite_libversion()); php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding()); php_info_print_table_end(); @@ -1620,10 +1620,12 @@ int filename_len; zval *errmsg = NULL; zval *object = getThis(); + zend_error_handling error_handling; - zend_replace_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception, NULL TSRMLS_CC); + zend_replace_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception, &error_handling TSRMLS_CC); if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/", &filename, &filename_len, &mode, &errmsg)) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } if (errmsg) { @@ -1634,6 +1636,7 @@ if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) { /* resolve the fully-qualified path name to use as the hash key */ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { + zend_restore_error_handling(&error_handling TSRMLS_CC); if (object) { RETURN_NULL(); } else { @@ -1644,6 +1647,7 @@ if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(fullpath TSRMLS_CC)) { efree(fullpath); + zend_restore_error_handling(&error_handling TSRMLS_CC); if (object) { RETURN_NULL(); } else { @@ -1657,6 +1661,7 @@ if (fullpath) { efree(fullpath); } + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -1668,10 +1673,12 @@ char *filename, *fullpath = NULL; int filename_len; zval *errmsg = NULL; + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, sqlite_ce_exception, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, sqlite_ce_exception, &error_handling TSRMLS_CC); if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/", &filename, &filename_len, &mode, &errmsg)) { + zend_restore_error_handling(&error_handling TSRMLS_CC); RETURN_NULL(); } if (errmsg) { @@ -1682,12 +1689,14 @@ if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) { /* resolve the fully-qualified path name to use as the hash key */ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { + zend_restore_error_handling(&error_handling TSRMLS_CC); RETURN_NULL(); } if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(fullpath TSRMLS_CC)) { efree(fullpath); + zend_restore_error_handling(&error_handling TSRMLS_CC); RETURN_NULL(); } } @@ -1696,6 +1705,7 @@ if (fullpath) { efree(fullpath); } + zend_restore_error_handling(&error_handling TSRMLS_CC); } /* }}} */ @@ -2356,6 +2366,7 @@ zend_replace_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception, &error_handling TSRMLS_CC); if (object) { if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|szb", &class_name, &class_name_len, &ctor_params, &decode_binary)) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } RES_FROM_OBJECT(res, object); @@ -2366,6 +2377,7 @@ } } else { if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|szb", &zres, &class_name, &class_name_len, &ctor_params, &decode_binary)) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } ZEND_FETCH_RESOURCE(res, struct php_sqlite_result *, &zres, -1, "sqlite result", le_sqlite_result); @@ -2378,12 +2390,14 @@ if (!ce) { zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Could not find class '%s'", class_name); + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } if (res->curr_row < res->nrows) { php_sqlite_fetch_array(res, PHPSQLITE_ASSOC, decode_binary, 1, &dataset TSRMLS_CC); } else { + zend_restore_error_handling(&error_handling TSRMLS_CC); RETURN_FALSE; } http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.1.2.17&r2=1.1.2.18&diff_format=u Index: php-src/ext/sqlite3/sqlite3.c diff -u php-src/ext/sqlite3/sqlite3.c:1.1.2.17 php-src/ext/sqlite3/sqlite3.c:1.1.2.18 --- php-src/ext/sqlite3/sqlite3.c:1.1.2.17 Tue Nov 18 14:27:09 2008 +++ php-src/ext/sqlite3/sqlite3.c Wed Nov 19 02:00:53 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sqlite3.c,v 1.1.2.17 2008/11/18 14:27:09 pajoye Exp $ */ +/* $Id: sqlite3.c,v 1.1.2.18 2008/11/19 02:00:53 colder Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1179,11 +1179,13 @@ zval *db_zval; char *sql; int sql_len, errcode; + zend_error_handling error_handling; stmt_obj = (php_sqlite3_stmt *)zend_object_store_get_object(object TSRMLS_CC); - zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &db_zval, php_sqlite3_sc_entry, &sql, &sql_len) == FAILURE) { + zend_restore_error_handling(&error_handling TSRMLS_CC); return; } @@ -1191,6 +1193,8 @@ SQLITE3_CHECK_INITIALIZED(db_obj->initialised, SQLite3) + zend_restore_error_handling(&error_handling TSRMLS_CC); + if (!sql_len) { RETURN_FALSE; } @@ -1377,11 +1381,14 @@ php_sqlite3_result *result_obj; zval *object = getThis(); result_obj = (php_sqlite3_result *)zend_object_store_get_object(object TSRMLS_CC); + zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLite3Result cannot be directly instantiated"); + zend_restore_error_handling(&error_handling TSRMLS_CC); + } /* }}} */ http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug46241.phpt?view=markup&rev=1.1 Index: ZendEngine2/tests/bug46241.phpt +++ ZendEngine2/tests/bug46241.phpt --TEST-- Bug #46241 (error handler stacks) --FILE-- <?php class ErrorHandling { public function errorHandler1( $errno, $errstr ) { echo "Caught on first level: '$errstr'\n"; return true; } public function errorHandler2( $errno, $errstr ) { echo "Caught on second level: '$errstr'\n"; return true; } } $err = new ErrorHandling(); set_error_handler( array( $err, 'errorHandler1' ) ); set_error_handler( array( $err, 'errorHandler2' ) ); trigger_error( 'Foo', E_USER_WARNING ); function errorHandler1( $errno, $errstr ) { echo "Caught on first level: '$errstr'\n"; return true; } function errorHandler2( $errno, $errstr ) { echo "Caught on second level: '$errstr'\n"; return true; } set_error_handler( 'errorHandler1' ); set_error_handler( 'errorHandler2' ); trigger_error( 'Foo', E_USER_WARNING ); ?> ==END== --EXPECT-- Caught on second level: 'Foo' Caught on second level: 'Foo' ==END==
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php