diff options
-rw-r--r-- | Zend/tests/bug79599.phpt | 27 | ||||
-rw-r--r-- | Zend/zend.c | 8 |
2 files changed, 1 insertions, 34 deletions
diff --git a/Zend/tests/bug79599.phpt b/Zend/tests/bug79599.phpt deleted file mode 100644 index da72d1c5b7..0000000000 --- a/Zend/tests/bug79599.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #79599 (coredump in set_error_handler) ---FILE-- -<?php -set_error_handler(function($code, $message){ - throw new \Exception($message); -}); -function test1(){ - $a[] = $b; -} -function test2(){ - $a[$c] = $b; -} -try{ - test1(); -}catch(\Exception $e){ - var_dump($e->getMessage()); -} -try{ - test2(); -}catch(\Exception $e){ - var_dump($e->getMessage()); -} -?> ---EXPECT-- -string(21) "Undefined variable: b" -string(21) "Undefined variable: c" diff --git a/Zend/zend.c b/Zend/zend.c index ed2e87812f..10a678831c 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1254,10 +1254,6 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */ } \ } while (0) -static void arg_copy_ctor(zval *zv) { - zval_copy_ctor(zv); -} - static ZEND_COLD void zend_error_va_list( int type, const char *error_filename, uint32_t error_lineno, const char *format, va_list args) @@ -1351,9 +1347,7 @@ static ZEND_COLD void zend_error_va_list( if (!symbol_table) { ZVAL_NULL(¶ms[4]); } else { - array_init(¶ms[4]); - /* always try to do noninvasive duplication */ - zend_hash_copy(Z_ARRVAL(params[4]), symbol_table, arg_copy_ctor); + ZVAL_ARR(¶ms[4], zend_array_dup(symbol_table)); } ZVAL_COPY_VALUE(&orig_user_error_handler, &EG(user_error_handler)); |