Index: Zend/zend_execute_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute_API.c,v retrieving revision 1.331.2.20.2.24.2.56 diff -u -p -r1.331.2.20.2.24.2.56 zend_execute_API.c --- Zend/zend_execute_API.c 26 Aug 2008 08:38:26 -0000 1.331.2.20.2.24.2.56 +++ Zend/zend_execute_API.c 13 Sep 2008 14:28:22 -0000 @@ -970,7 +970,6 @@ ZEND_API int zend_lookup_class_ex(const int retval; char *lc_name; char *lc_free; - zval *exception; zend_fcall_info fcall_info; zend_fcall_info_cache fcall_cache; char dummy = 1; @@ -1035,7 +1034,6 @@ ZEND_API int zend_lookup_class_ex(const 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); EG(autoload_func) = fcall_cache.function_handler; @@ -1044,23 +1042,22 @@ ZEND_API int zend_lookup_class_ex(const zend_hash_del(EG(in_autoload), lc_name, name_length + 1); + zend_exception_restore(TSRMLS_C); + if (retval == FAILURE) { - zend_exception_restore(TSRMLS_C); free_alloca(lc_free, use_heap); return FAILURE; } - if (EG(exception) && exception) { - zend_exception_restore(TSRMLS_C); - free_alloca(lc_free, use_heap); - zend_error(E_ERROR, "Function %s(%s) threw an exception of type '%s'", ZEND_AUTOLOAD_FUNC_NAME, name, Z_OBJCE_P(EG(exception))->name); - return FAILURE; - } - zend_exception_restore(TSRMLS_C); if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } + if (EG(exception)) { + free_alloca(lc_free, use_heap); + return FAILURE; + } + retval = zend_hash_find(EG(class_table), lc_name, name_length + 1, (void **) ce); free_alloca(lc_free, use_heap); return retval; @@ -1493,7 +1490,7 @@ check_fetch_type: if (rt_ns_check && zend_lookup_class_ex(class_name, class_name_len, 1, &pce TSRMLS_CC) == SUCCESS) { return *pce; } - if (!silent) { + if (!silent && !EG(exception)) { if (fetch_type == ZEND_FETCH_CLASS_INTERFACE) { zend_error(E_ERROR, "Interface '%s' not found", class_name); } else {