com php-src: Fixed bug #70006 (cli - function with default arg = STDOUT crash output).: NEWS Zend/zend_exe cute_API.c sapi/cli/tests/bug70006.phpt

From: Date: Tue, 07 Jul 2015 11:21:02 +0000
Subject: com php-src: Fixed bug #70006 (cli - function with default arg = STDOUT crash output).: NEWS Zend/zend_exe cute_API.c sapi/cli/tests/bug70006.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87780@lists.php.net to get a copy of this message
Commit: 7af4e6d02d678b9e31c192e8adfc3bb9d6277f5a Author: Xinchen Hui <laruence@php.net> Tue, 7 Jul 2015 19:21:02 +0800 Parents: 333528089e053b1db35a073955b3ec7244881667 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7af4e6d02d678b9e31c192e8adfc3bb9d6277f5a Log: Fixed bug #70006 (cli - function with default arg = STDOUT crash output). Bugs: https://bugs.php.net/70006 Changed paths: M NEWS M Zend/zend_execute_API.c A sapi/cli/tests/bug70006.phpt Diff: diff --git a/NEWS b/NEWS index 365f0ee..5de290a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS 09 Jul 2015, PHP 7.0.0 Beta 1 - Core: + . Fixed bug #70006 (cli - function with default arg = STDOUT crash output). + (Laruence) . Fixed bug #69521 (Segfault in gc_collect_cycles()). (arjen at react dot com, Laruence) . Improved zend_string API (Francois Laupretre) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index fc92494..29d0673 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -555,11 +555,9 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas zend_throw_error(zend_ce_error, "Cannot declare self-referencing constant '%s'", Z_STRVAL_P(p)); return FAILURE; } else if (Z_TYPE_P(p) == IS_CONSTANT) { - int refcount; SEPARATE_ZVAL_NOREF(p); MARK_CONSTANT_VISITED(p); - refcount = Z_REFCOUNTED_P(p) ? Z_REFCOUNT_P(p) : 1; if (Z_CONST_FLAGS_P(p) & IS_CONSTANT_CLASS) { ZEND_ASSERT(EG(current_execute_data)); if (inline_change) { @@ -639,8 +637,6 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas } zval_opt_copy_ctor(p); } - - if (Z_REFCOUNTED_P(p)) Z_SET_REFCOUNT_P(p, refcount); } else if (Z_TYPE_P(p) == IS_CONSTANT_AST) { zval tmp; diff --git a/sapi/cli/tests/bug70006.phpt b/sapi/cli/tests/bug70006.phpt new file mode 100644 index 0000000..855c9e1 --- /dev/null +++ b/sapi/cli/tests/bug70006.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #70006 (cli - function with default arg = STDOUT crash output) +--SKIPIF-- +<?php +include "skipif.inc"; +?> +--FILE-- +<?php + +function foo1($stream = STDOUT) +{ + //do nothing +} +foo1(); +?> +okey +--EXPECT-- +okey

« previous php.cvs (#87780) next »