com php-src: Merge branch 'master' into phpng: ext/date/php_d ate.c ext/date/tests/bug51866.phpt ext/opcach e/Optimizer/zend_optimizer.c
ext/zip/php_zip.c
| From: | Dmitry Stogov | Date: | Mon, 26 May 2014 06:52:43 +0000 |
| Subject: | com php-src: Merge branch 'master' into phpng: ext/date/php_d ate.c ext/date/tests/bug51866.phpt ext/opcach e/Optimizer/zend_optimizer.c ext/zip/php_zip.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78539@lists.php.net to get a copy of this message | ||
Commit: 9dd66e4d537073ea311929a65622d898193618c8
Author: Dmitry Stogov <dmitry@zend.com> Mon, 26 May 2014 10:52:43 +0400
Parents: 066c1d5451a33c652e23a59e6455dca331007919 347b430a03a394f31048ad16b2bbc22e29f3baf5
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9dd66e4d537073ea311929a65622d898193618c8
Log:
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
Bugs:
https://bugs.php.net/183
https://bugs.php.net/62479
https://bugs.php.net/67060
Changed paths:
MM ext/date/php_date.c
MM ext/date/tests/bug51866.phpt
MM ext/opcache/Optimizer/zend_optimizer.c
MM ext/zip/php_zip.c
Diff:
diff --cc ext/date/php_date.c
index 3d203eb,e8a7ebf..493033b
--- 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 01ca555,9474f4f..9481aeb
--- 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 602a63e,fc7d0a2..7244aaf
--- 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 9f5d9d0,a9db166..053cc68
--- 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;
}