cvs: php-src /ext/spl/tests spl_autoload_012.phpt ZendEngine2 zend_execute_API.c

From: Date: Mon, 15 Sep 2008 10:19:15 +0000
Subject: cvs: php-src /ext/spl/tests spl_autoload_012.phpt ZendEngine2 zend_execute_API.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-53150@lists.php.net to get a copy of this message
colder Mon Sep 15 10:19:15 2008 UTC Modified files: /ZendEngine2 zend_execute_API.c /php-src/ext/spl/tests spl_autoload_012.phpt Log: Fix #45656 (new Class silenting exceptions in autoloaders) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.462&r2=1.463&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.462 ZendEngine2/zend_execute_API.c:1.463 --- ZendEngine2/zend_execute_API.c:1.462 Tue Aug 26 08:38:15 2008 +++ ZendEngine2/zend_execute_API.c Mon Sep 15 10:19:14 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.462 2008/08/26 08:38:15 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.463 2008/09/15 10:19:14 colder Exp $ */ #include <stdio.h> #include <signal.h> @@ -1032,7 +1032,6 @@ int retval; unsigned int lc_name_len; zstr lc_name, lc_free; - zval *exception; char dummy = 1; zend_fcall_info fcall_info; zend_fcall_info_cache fcall_cache; @@ -1116,9 +1115,10 @@ fcall_cache.called_scope = NULL; fcall_cache.object_pp = NULL; - exception = EG(exception); zend_exception_save(TSRMLS_C); retval = zend_call_function(&fcall_info, &fcall_cache TSRMLS_CC); + zend_exception_restore(TSRMLS_C); + EG(autoload_func) = fcall_cache.function_handler; if (UG(unicode)) { @@ -1129,26 +1129,16 @@ zend_u_hash_del(EG(in_autoload), type, lc_name, lc_name_len + 1); - if (retval == FAILURE) { - zend_exception_restore(TSRMLS_C); - if (do_normalize) { - efree(lc_free.v); - } - return FAILURE; + if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); } - if (EG(exception) && exception) { - zend_exception_restore(TSRMLS_C); + if (retval == FAILURE) { if (do_normalize) { efree(lc_free.v); } - zend_error(E_ERROR, "Function %s(%R) threw an exception of type '%v'", ZEND_AUTOLOAD_FUNC_NAME, type, name, Z_OBJCE_P(EG(exception))->name); return FAILURE; } - zend_exception_restore(TSRMLS_C); - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } retval = zend_u_hash_find(EG(class_table), type, lc_name, lc_name_len + 1, (void **) ce); if (do_normalize) { @@ -1639,15 +1629,13 @@ } } if (use_autoload) { - if (rt_ns_check && - zend_u_lookup_class_ex(type, lcname, class_name_len, class_name, 0, &pce TSRMLS_CC) == SUCCESS - ) { + if (rt_ns_check && zend_u_lookup_class_ex(type, lcname, class_name_len, class_name, 0, &pce TSRMLS_CC) == SUCCESS) { if (lcname.v != class_name.v) { efree(lcname.v); } return *pce; } - if (!silent) { + if (!silent && !EG(exception)) { if (fetch_type == ZEND_FETCH_CLASS_INTERFACE) { zend_error(E_ERROR, "Interface '%R' not found", type, class_name); } else { http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_012.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/spl/tests/spl_autoload_012.phpt diff -u php-src/ext/spl/tests/spl_autoload_012.phpt:1.2 php-src/ext/spl/tests/spl_autoload_012.phpt:1.3 --- php-src/ext/spl/tests/spl_autoload_012.phpt:1.2 Fri Aug 8 14:09:15 2008 +++ php-src/ext/spl/tests/spl_autoload_012.phpt Mon Sep 15 10:19:15 2008 @@ -26,6 +26,14 @@ } while($e = $e->getPrevious()); } +try { + new ThisClassDoesNotExist; +} catch(Exception $e) { + do { + echo $e->getMessage()."\n"; + } while($e = $e->getPrevious()); +} + class_exists('ThisClassDoesNotExist'); ?> ===DONE=== @@ -36,6 +44,10 @@ first autoload_first autoload_second +second +first +autoload_first +autoload_second Fatal error: Uncaught exception 'Exception' with message 'first' in %sspl_autoload_012.php:%d Stack trace:

« previous php.cvs (#53150) next »