cvs: ZendEngine2 / zend.c /tests bug33802.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Fri, 22 Jul 2005 07:33:04 +0000 |
| Subject: | cvs: ZendEngine2 / zend.c /tests bug33802.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3931@lists.php.net to get a copy of this message | ||
dmitry Fri Jul 22 03:33:04 2005 EDT
Added files:
/ZendEngine2/tests bug33802.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend.c
Log:
Fixed bug #33802 (throw Exception in error handler causes crash)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2004&r2=1.2005&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2004 php-src/NEWS:1.2005
--- php-src/NEWS:1.2004 Wed Jul 20 19:06:49 2005
+++ php-src/NEWS Fri Jul 22 03:32:59 2005
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2005, PHP 5.1
+- Fixed bug #33802 (throw Exception in error handler causes crash). (Dmitry)
- Fixed bug #33710 (ArrayAccess objects doen't initialize $this). (Dmitry)
- Fixed bug #33578 (strtotime() problem with "Oct17" format). (Derick)
- Fixed bug #33558 (warning with nested calls to functions returning by
http://cvs.php.net/diff.php/ZendEngine2/zend.c?r1=1.306&r2=1.307&ty=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.306 ZendEngine2/zend.c:1.307
--- ZendEngine2/zend.c:1.306 Mon Jun 27 18:04:41 2005
+++ ZendEngine2/zend.c Fri Jul 22 03:33:03 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.c,v 1.306 2005/06/27 22:04:41 sniper Exp $ */
+/* $Id: zend.c,v 1.307 2005/07/22 07:33:03 dmitry Exp $ */
#include "zend.h"
#include "zend_extensions.h"
@@ -975,8 +975,7 @@
z_context->value.ht = EG(active_symbol_table);
z_context->type = IS_ARRAY;
- ZVAL_ADDREF(z_context); /* we don't want this one to be freed */
- z_context->is_ref = 1;
+ zval_copy_ctor(z_context);
params = (zval ***) emalloc(sizeof(zval **)*5);
params[0] = &z_error_type;
@@ -989,9 +988,6 @@
EG(user_error_handler) = NULL;
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5,
params, 1, NULL TSRMLS_CC)==SUCCESS) {
- if (Z_TYPE_P(z_context) != IS_ARRAY || z_context->value.ht != EG(active_symbol_table)) {
- zend_error(E_ERROR, "User error handler must not modify error context");
- }
if (retval) {
if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) {
zend_error_cb(type, error_filename, error_lineno, format, args);
@@ -1015,12 +1011,7 @@
zval_ptr_dtor(&z_error_type);
zval_ptr_dtor(&z_error_filename);
zval_ptr_dtor(&z_error_lineno);
- if (ZVAL_REFCOUNT(z_context) <= 2) {
- FREE_ZVAL(z_context);
- } else {
- ZVAL_DELREF(z_context);
- zval_ptr_dtor(&z_context);
- }
+ zval_ptr_dtor(&z_context);
break;
}
http://cvs.php.net/co.php/ZendEngine2/tests/bug33802.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug33802.phpt
+++ ZendEngine2/tests/bug33802.phpt
--TEST--
Bug #33802 (throw Exception in error handler causes crash)
--FILE--
<?php
set_error_handler('errorHandler', E_USER_ERROR);
try{
test();
}catch(Exception $e){
}
restore_error_handler();
function test(){
trigger_error("error", E_USER_ERROR);
}
function errorHandler($errno, $errstr, $errfile, $errline) {
throw new Exception();
}
?>
ok
--EXPECT--
ok