From: Dmitry Stogov Date: Mon, 26 May 2014 06:52:43 +0000 (+0400) Subject: Merge branch 'master' into phpng X-Git-Tag: POST_PHPNG_MERGE~287 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9dd66e4d537073ea311929a65622d898193618c8;p=php Merge branch 'master' into phpng * master: Fixed issue #183 (TMP_VAR is not only used once) Fix broken Junit output with --disable-cgi Added folder mark Further test fixes for the fdb2709 breakage. Fix broken test caused by fdb2709. Added tests for ZipArchive::addGlob() and ZipArchive::addPattern() Fix run-tests.php with Valgrind >= 3.10.0. Add microseconds to the serialised form of DateTime objects. Improved test for bug #62479 fix typo in ODBC code gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir 5.5.14 now Fix bug #67060: use default mode of 660 Conflicts: ext/date/php_date.c --- 9dd66e4d537073ea311929a65622d898193618c8 diff --cc ext/date/php_date.c index 3d203eb227,e8a7ebfe1a..493033b60b --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@@ -2196,8 -2217,9 +2196,8 @@@ static HashTable *date_object_get_prope } /* first we add the date and time in ISO format */ - ZVAL_STR(&zv, date_format("Y-m-d H:i:s", sizeof("Y-m-d H:i:s")-1, dateobj->time, 1 TSRMLS_CC)); - MAKE_STD_ZVAL(zv); - ZVAL_STRING(zv, date_format("Y-m-d H:i:s.u", 14, dateobj->time, 1), 0); - zend_hash_update(props, "date", 5, &zv, sizeof(zv), NULL); ++ ZVAL_STR(&zv, date_format("Y-m-d H:i:s.u", sizeof("Y-m-d H:i:s.u")-1, dateobj->time, 1 TSRMLS_CC)); + zend_hash_str_update(props, "date", sizeof("date")-1, &zv); /* then we add the timezone name (or similar) */ if (dateobj->time->is_localtime) { diff --cc ext/date/tests/bug51866.phpt index 01ca555fd9,9474f4f58d..9481aebe9d --- a/ext/date/tests/bug51866.phpt +++ b/ext/date/tests/bug51866.phpt @@@ -44,9 -44,9 +44,9 @@@ array(4) string(6) "Y-m-d+" string(19) "2001-11-29 13:20:01" -object(DateTime)#2 (3) { +object(DateTime)#%d (3) { ["date"]=> - string(19) "2001-11-29 %d:%d:%d" + string(26) "2001-11-29 %d:%d:%d.%d" ["timezone_type"]=> int(3) ["timezone"]=> @@@ -70,9 -70,9 +70,9 @@@ array(4) string(7) "Y-m-d +" string(19) "2001-11-29 13:20:01" -object(DateTime)#3 (3) { +object(DateTime)#%d (3) { ["date"]=> - string(19) "2001-11-29 %d:%d:%d" + string(26) "2001-11-29 %d:%d:%d.%d" ["timezone_type"]=> int(3) ["timezone"]=> @@@ -96,9 -96,9 +96,9 @@@ array(4) string(6) "Y-m-d+" string(10) "2001-11-29" -object(DateTime)#2 (3) { +object(DateTime)#%d (3) { ["date"]=> - string(19) "2001-11-29 %d:%d:%d" + string(26) "2001-11-29 %d:%d:%d.%d" ["timezone_type"]=> int(3) ["timezone"]=> @@@ -139,9 -139,9 +139,9 @@@ array(4) string(7) "Y-m-d +" string(11) "2001-11-29 " -object(DateTime)#2 (3) { +object(DateTime)#%d (3) { ["date"]=> - string(19) "2001-11-29 %d:%d:%d" + string(26) "2001-11-29 %d:%d:%d.%d" ["timezone_type"]=> int(3) ["timezone"]=> diff --cc ext/opcache/Optimizer/zend_optimizer.c index 602a63ec0b,fc7d0a29b3..7244aafcc0 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@@ -381,9 -367,26 +381,26 @@@ static void replace_tmp_by_const(zend_o if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR && ZEND_OP1(opline).var == var) { - update_op1_const(op_array, opline, val TSRMLS_CC); - /* TMP_VAR my be used only once */ - break; + /* In most cases IS_TMP_VAR operand may be used only once. + * The operands are usually destroyed by the opcode handler. + * ZEND_CASE is an exception, that keeps operand unchanged, + * and allows its reuse. The number of ZEND_CASE instructions + * usually terminated by ZEND_FREE that finally kills the value. + */ + if (opline->opcode == ZEND_CASE) { + zval old_val; - old_val = *val; ++ ZVAL_COPY_VALUE(&old_val, val); + zval_copy_ctor(val); + update_op1_const(op_array, opline, val TSRMLS_CC); - *val = old_val; ++ ZVAL_COPY_VALUE(val, &old_val); + } else if (opline->opcode == ZEND_FREE) { + MAKE_NOP(opline); + break; + } else { + update_op1_const(op_array, opline, val TSRMLS_CC); + val = NULL; + break; + } } if (ZEND_OP2_TYPE(opline) == IS_TMP_VAR && diff --cc ext/zip/php_zip.c index 9f5d9d03ca,a9db166c83..053cc68058 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@@ -328,8 -374,8 +328,8 @@@ static int php_zip_parse_options(zval * } /* If I add more options, it would make sense to create a nice static struct and loop over it. */ - if ((options = zend_hash_str_find(HASH_OF(options), "remove_path", sizeof("remove_path") - 1)) != NULL) { - if (zend_hash_find(HASH_OF(options), "remove_path", sizeof("remove_path"), (void **)&option) == SUCCESS) { - if (Z_TYPE_PP(option) != IS_STRING) { ++ if ((option = zend_hash_str_find(HASH_OF(options), "remove_path", sizeof("remove_path") - 1)) != NULL) { + if (Z_TYPE_P(option) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "remove_path option expected to be a string"); return -1; }