[PHP-CVS] cvs: php-src /ext/date php_date.c /ext/dom attr.c cdatasection.c comment.c document.c documentfragment.c element.c entityreference.c processinginstruction.c text.c xpath.c /ext/mysqli mysq

2008-11-18 Thread Etienne Kneuss
colder  Wed Nov 19 01:59:08 2008 UTC

  Added files: 
/ZendEngine2/tests  bug46241.phpt 

  Modified files:  
/ZendEngine2zend_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/domattr.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/splspl_array.c spl_directory.c spl_iterators.c 
spl_observer.c 
/php-src/ext/sqlite sqlite.c 
/php-src/ext/sqlite3sqlite3.c 
  Log:
  Fix #46241 (stacked error_handlers, error_handling in general)
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.466r2=1.467diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.466 
ZendEngine2/zend_execute_API.c:1.467
--- ZendEngine2/zend_execute_API.c:1.466Thu Oct  2 19:53:48 2008
+++ ZendEngine2/zend_execute_API.c  Wed Nov 19 01:59:06 2008
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_execute_API.c,v 1.466 2008/10/02 19:53:48 colder Exp $ */
+/* $Id: zend_execute_API.c,v 1.467 2008/11/19 01:59:06 colder Exp $ */
 
 #include stdio.h
 #include signal.h
@@ -956,14 +956,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)
@@ -984,10 +981,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.247r2=1.248diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.247 ZendEngine2/zend_vm_def.h:1.248
--- ZendEngine2/zend_vm_def.h:1.247 Mon Oct  6 00:35:19 2008
+++ ZendEngine2/zend_vm_def.h   Wed Nov 19 01:59:07 2008
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: zend_vm_def.h,v 1.247 2008/10/06 00:35:19 felipe Exp $ */
+/* $Id: zend_vm_def.h,v 1.248 2008/11/19 01:59:07 colder Exp $ */
 
 /* If you change this file, please regenerate the zend_vm_execute.h and
  * zend_vm_opcodes.h files by running:
@@ -2342,7 +2342,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;
@@ -2357,14 +2356,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_T(opline-result.u.var).var.ptr, 
EX(object), 

[PHP-CVS] cvs: php-src /ext/date php_date.c /ext/dom attr.c cdatasection.c comment.c document.c documentfragment.c element.c entityreference.c processinginstruction.c text.c xpath.c /ext/mysqli mysq

2008-08-08 Thread Etienne Kneuss
colder  Fri Aug  8 22:06:43 2008 UTC

  Modified files:  
/php-src/ext/sqlite sqlite.c 
/php-src/ext/splspl_array.c spl_iterators.c spl_observer.c 
spl_directory.c 
/php-src/ext/mysqli mysqli_driver.c 
/php-src/ext/simplexml  simplexml.c 
/php-src/ext/date   php_date.c 
/php-src/ext/domdocumentfragment.c element.c 
processinginstruction.c attr.c document.c 
entityreference.c comment.c xpath.c text.c 
cdatasection.c 
  Log:
  Fix error_handling usage in various extensions
  http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.212r2=1.213diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.212 php-src/ext/sqlite/sqlite.c:1.213
--- php-src/ext/sqlite/sqlite.c:1.212   Sat Aug  2 04:40:45 2008
+++ php-src/ext/sqlite/sqlite.c Fri Aug  8 22:06:42 2008
@@ -17,7 +17,7 @@
|  Marcus Boerger [EMAIL PROTECTED]  |
+--+
 
-   $Id: sqlite.c,v 1.212 2008/08/02 04:40:45 felipe Exp $
+   $Id: sqlite.c,v 1.213 2008/08/08 22:06:42 colder Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1612,7 +1612,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.212 2008/08/02 04:40:45 felipe 
Exp $);
+   php_info_print_table_row(2, PECL Module version, 
PHP_SQLITE_MODULE_VERSION  $Id: sqlite.c,v 1.213 2008/08/08 22:06:42 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();
@@ -1780,10 +1780,9 @@
zval *errmsg = NULL;
zval *object = getThis();
 
-   php_set_error_handling(object ? EH_THROW : EH_NORMAL, 
sqlite_ce_exception TSRMLS_CC);
+   zend_replace_error_handling(object ? EH_THROW : EH_NORMAL, 
sqlite_ce_exception, NULL TSRMLS_CC);
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
Z|lz/, ppfilename, mode, errmsg) ||
FAILURE == php_stream_path_param_encode(ppfilename, filename, 
filename_len, REPORT_ERRORS, FG(default_context))) {
-   php_std_error_handling();
return;
}
if (errmsg) {
@@ -1794,7 +1793,6 @@
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))) {
-   php_std_error_handling();
if (object) {
RETURN_NULL();
} else {
@@ -1803,7 +1801,6 @@
}
 
if (php_check_open_basedir(fullpath TSRMLS_CC)) {
-   php_std_error_handling();
efree(fullpath);
if (object) {
RETURN_NULL();
@@ -1818,7 +1815,6 @@
if (fullpath) {
efree(fullpath);
}
-   php_std_error_handling();
 }
 /* }}} */
 
@@ -1832,10 +1828,9 @@
int filename_len;
zval *errmsg = NULL;
 
-   php_set_error_handling(EH_THROW, sqlite_ce_exception TSRMLS_CC);
+   zend_replace_error_handling(EH_THROW, sqlite_ce_exception, NULL 
TSRMLS_CC);
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
Z|lz/, ppfilename, mode, errmsg) ||
FAILURE == php_stream_path_param_encode(ppfilename, filename, 
filename_len, REPORT_ERRORS, FG(default_context))) {
-   php_std_error_handling();
RETURN_NULL();
}
if (errmsg) {
@@ -1846,13 +1841,11 @@
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))) {
-   php_std_error_handling();
RETURN_NULL();
}
 
if (php_check_open_basedir(fullpath TSRMLS_CC)) {
efree(fullpath);
-   php_std_error_handling();
RETURN_NULL();
}
}
@@ -1861,7 +1854,6 @@
if (fullpath) {
efree(fullpath);
}
-   php_std_error_handling();
 }
 /* }}} */
 
@@ -2629,11 +2621,11 @@
zval *retval_ptr;
zval *ctor_params = NULL;
zend_uchar class_name_type;
+   zend_error_handling error_handling;
 
-   php_set_error_handling(object ? EH_THROW : EH_NORMAL, 
sqlite_ce_exception TSRMLS_CC);
+   zend_replace_error_handling(object ? EH_THROW : EH_NORMAL,