diff options
author | Joe Watkins <krakjoe@php.net> | 2017-01-26 09:04:52 +0000 |
---|---|---|
committer | Joe Watkins <krakjoe@php.net> | 2017-01-26 09:05:10 +0000 |
commit | 306f55bef43f18bd0502dcd9f14089eec4a19d0d (patch) | |
tree | 921018dadedc8636048447d7bf442ed905175273 | |
parent | 4e3a4c119d2bdc349cb03a51dc08e2b67808dd34 (diff) | |
parent | 2d339fa4d1e82c888e4f514a741eb7ac14055671 (diff) | |
download | php-git-306f55bef43f18bd0502dcd9f14089eec4a19d0d.tar.gz |
Merge branch 'PHP-7.1'
* PHP-7.1:
Fixed #73973 - debug_zval_dump() assertion error for resource consts with --enable-debug
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | Zend/zend_builtin_functions.c | 8 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 8 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/bug73973.phpt | 9 |
4 files changed, 14 insertions, 12 deletions
@@ -25,6 +25,7 @@ PHP NEWS . Fixed bug #73969 (segfault in debug_print_backtrace). (andrewnester) . Added PHP_OS_FAMILY constant to determine on which OS we are. (Jan Altensen) . Fixed bug #73994 (arginfo incorrect for unpack). (krakjoe) + . Fixed bug #73973 (assertion error in debug_zval_dump). (andrewnester) - BCMath: . Fixed bug #46564 (bcmod truncates fractionals). (liborm85) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 811ae08ee2..0f3e321ba3 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -879,9 +879,6 @@ static void copy_constant_array(zval *dst, zval *src) /* {{{ */ } } else if (Z_REFCOUNTED_P(val)) { Z_ADDREF_P(val); - if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_RESOURCE_EX)) { - Z_TYPE_INFO_P(new_val) &= ~(IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT); - } } } ZEND_HASH_FOREACH_END(); } @@ -924,12 +921,7 @@ repeat: case IS_FALSE: case IS_TRUE: case IS_NULL: - break; case IS_RESOURCE: - ZVAL_COPY(&val_free, val); - /* TODO: better solution than this tricky disable dtor on resource? */ - Z_TYPE_INFO(val_free) &= ~(IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT); - val = &val_free; break; case IS_ARRAY: if (Z_REFCOUNTED_P(val)) { diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index e6ee1b6d4d..d183e2b27d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -346,6 +346,10 @@ void shutdown_executor(void) /* {{{ */ } zend_end_try(); zend_try { + clean_non_persistent_constants(); + } zend_end_try(); + + zend_try { zend_close_rsrc_list(&EG(regular_list)); } zend_end_try(); @@ -377,10 +381,6 @@ void shutdown_executor(void) /* {{{ */ } zend_end_try(); zend_try { - clean_non_persistent_constants(); - } zend_end_try(); - - zend_try { #if 0&&ZEND_DEBUG signal(SIGSEGV, original_sigsegv_handler); #endif diff --git a/ext/standard/tests/general_functions/bug73973.phpt b/ext/standard/tests/general_functions/bug73973.phpt new file mode 100644 index 0000000000..8bb4daaab0 --- /dev/null +++ b/ext/standard/tests/general_functions/bug73973.phpt @@ -0,0 +1,9 @@ +--TEST-- +Bug #73973 debug_zval_dump() assertion error for resource consts with --enable-debug +--FILE-- +<?php +define('myerr', fopen('php://stderr', 'w')); +debug_zval_dump(myerr); +?> +--EXPECTF-- +resource(5) of type (stream) refcount(%d) |