]> granicus.if.org Git - php/commitdiff
Merge branch 'master' into phpng
authorDmitry Stogov <dmitry@zend.com>
Mon, 26 May 2014 06:52:43 +0000 (10:52 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 26 May 2014 06:52:43 +0000 (10:52 +0400)
* 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

1  2 
ext/date/php_date.c
ext/date/tests/bug51866.phpt
ext/opcache/Optimizer/zend_optimizer.c
ext/zip/php_zip.c

index 3d203eb2275d3d6365e482f415657398792ab4b9,e8a7ebfe1adcbfdb67bc48915f318e574f8abf5b..493033b60bb9c68eafa2551fa63ee4d5b1fddab8
@@@ -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) {
index 01ca555fd951d24a32a2ac49a121e7d76425befa,9474f4f58d44d202db0551041edd4f8e2af14a0e..9481aebe9d40bf1c168060c9b92e422c3e159b03
@@@ -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"]=>
index 602a63ec0b92f079bc934d51f1c0f11cedb1b522,fc7d0a29b3f911a0f6c6b4e818cb67e63cbd68ea..7244aafcc02a3f3faed6f44afca18aad62e025ac
@@@ -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 &&
index 9f5d9d03ca7637b2445b6dee349210bbbb3e3b4d,a9db166c839b24cbebccad95120bd535e720038f..053cc680580fb3d81e5a951c5a7ab1291d3d6670
@@@ -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;
                }