]> granicus.if.org Git - php/commitdiff
Merge branch 'master' into phpng
authorDmitry Stogov <dmitry@zend.com>
Tue, 22 Jul 2014 11:42:17 +0000 (15:42 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 22 Jul 2014 11:42:17 +0000 (15:42 +0400)
* master:
  fix nmake snap when ext name is different in target dll
  force atoll macro usage on windows
  Enable $ replacement in exif, ldap, pdo_pgsql and tidy
  See bug #67635
  NEWS
  NEWS
  improve previous, add message during configure
  Fixed bug #67635 php links to systemd libraries without using pkg-config
  Improve fix for #66608
  Fixed segfault with empty break
  New added opcodes don't need to be resloved
  Update NEWS
  Update NEWS
  Update NEWS
  Fixed bug #66827 Session raises E_NOTICE when session name variable is array
  implemented copy libs of core exts in phpize mode
  fix copy the ext dll into the prefix path in phpize mode
  fix default prefix in phpize mode
  fix file with zero size usage in phpize mode

Conflicts:
Zend/zend_opcode.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/session/session.c

1  2 
Zend/zend_compile.h
Zend/zend_opcode.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/session/session.c
main/rfc1867.c

index a838a5814466edb696fc08d7ace0db058e71b98e,f86a41ae2bdf498a3a0cd9d515ebfb1e7e85f616..4c28be91f3de9e25e281da5805e24ae364c7e979
@@@ -840,13 -864,9 +840,13 @@@ int zend_add_literal(zend_op_array *op_
  #define ZEND_FAST_RET_TO_CATCH                1
  #define ZEND_FAST_RET_TO_FINALLY      2
  
- #define ZEND_FAST_CALL_FOR_CATCH      1
- #define ZEND_FAST_CALL_FOR_FINALLY    2
+ #define ZEND_FAST_CALL_FROM_CATCH     1
+ #define ZEND_FAST_CALL_FROM_FINALLY   2
  
 +#define ZEND_ARRAY_ELEMENT_REF                (1<<0)
 +#define ZEND_ARRAY_NOT_PACKED         (1<<1)
 +#define ZEND_ARRAY_SIZE_SHIFT         2
 +
  END_EXTERN_C()
  
  #define ZEND_CLONE_FUNC_NAME          "__clone"
index 2f0f0aeecd215cb4cd02578f8aca0458db1d80f2,bff314ef653486fda9d45ad2bc525a37fa253a4c..830959952166d89876412665188c8506aca2d209
@@@ -613,21 -677,22 +648,22 @@@ static void zend_resolve_finally_calls(
                                int nest_levels, array_offset;
                                zend_brk_cont_element *jmp_to;
  
 -                              nest_levels = Z_LVAL(op_array->literals[opline->op2.constant].constant);
 +                              nest_levels = Z_LVAL(op_array->literals[opline->op2.constant]);
-                               array_offset = opline->op1.opline_num;
-                               do {
-                                       jmp_to = &op_array->brk_cont_array[array_offset];
-                                       if (nest_levels > 1) {
-                                               array_offset = jmp_to->parent;
-                                       }
-                               } while (--nest_levels > 0);
-                               zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont TSRMLS_CC);
-                               break;
+                               if ((array_offset = opline->op1.opline_num) != -1) {
+                                       do {
+                                               jmp_to = &op_array->brk_cont_array[array_offset];
+                                               if (nest_levels > 1) {
+                                                       array_offset = jmp_to->parent;
+                                               }
+                                       } while (--nest_levels > 0);
+                                       zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont TSRMLS_CC);
+                                       break;
+                               }
                        }
                        case ZEND_GOTO:
 -                              if (Z_TYPE(op_array->literals[opline->op2.constant].constant) != IS_LONG) {
 +                              if (Z_TYPE(op_array->literals[opline->op2.constant]) != IS_LONG) {
                                        zend_uint num = opline->op2.constant;
 -                                      opline->op2.zv = &op_array->literals[opline->op2.constant].constant;
 +                                      opline->op2.zv = &op_array->literals[opline->op2.constant];
                                        zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC);
                                        opline->op2.constant = num;                                     
                                }
index 4b8f229c8df8275abf8342398587127cdb602d99,bff84db922be370634b5d8c3d24996039fbe21ab..48ad78915d2e2f00c327d21f86c1072e79d3e173
@@@ -5757,10 -5625,10 +5757,10 @@@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, AN
  {
        USE_OPLINE
  
-       if ((opline->extended_value & ZEND_FAST_CALL_FOR_CATCH) &&
+       if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
            UNEXPECTED(EG(prev_exception) != NULL)) {
            /* in case of unhandled exception jump to catch block instead of finally */
 -              ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
 +              ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
                ZEND_VM_CONTINUE();
        }
        EX(fast_ret) = opline;
@@@ -5773,8 -5641,8 +5773,8 @@@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY
  {
        if (EX(fast_ret)) {
                ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
-               if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FOR_FINALLY)) {
+               if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FROM_FINALLY)) {
 -                      EX(fast_ret) = &EX(op_array)->opcodes[EX(fast_ret)->op2.opline_num];
 +                      EX(fast_ret) = &EX(func)->op_array.opcodes[EX(fast_ret)->op2.opline_num];
                }
                ZEND_VM_CONTINUE();
        } else {
index d5bdb70762f37429ea777842aa1d146888bd0662,0151ea0684064f7516e8ccadd53c26da828878a8..df1731f1771c1ab62919ff02ec89567616d890f9
@@@ -1466,10 -1344,10 +1466,10 @@@ static int ZEND_FASTCALL  ZEND_FAST_CAL
  {
        USE_OPLINE
  
-       if ((opline->extended_value & ZEND_FAST_CALL_FOR_CATCH) &&
+       if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
            UNEXPECTED(EG(prev_exception) != NULL)) {
            /* in case of unhandled exception jump to catch block instead of finally */
 -              ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]);
 +              ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
                ZEND_VM_CONTINUE();
        }
        EX(fast_ret) = opline;
@@@ -1482,8 -1360,8 +1482,8 @@@ static int ZEND_FASTCALL  ZEND_FAST_RET
  {
        if (EX(fast_ret)) {
                ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
-               if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FOR_FINALLY)) {
+               if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FROM_FINALLY)) {
 -                      EX(fast_ret) = &EX(op_array)->opcodes[EX(fast_ret)->op2.opline_num];
 +                      EX(fast_ret) = &EX(func)->op_array.opcodes[EX(fast_ret)->op2.opline_num];
                }
                ZEND_VM_CONTINUE();
        } else {
index fdd6b1696a73a104ccbcdec49accf0498985132b,b24e6365f12ba91278fe4ab7a157eb726c7c7934..ff04462ca4efe864155d0d64a9a94b8919ad4f9d
@@@ -1405,9 -1437,16 +1405,16 @@@ PHPAPI const ps_serializer *_php_find_p
  }
  /* }}} */
  
- #define PPID2SID \
-               convert_to_string((ppid)); \
-               PS(id) = STR_INIT(Z_STRVAL_P(ppid), Z_STRLEN_P(ppid), 0)
 -static void ppid2sid(zval **ppid TSRMLS_DC) {
 -      if (Z_TYPE_PP(ppid) != IS_STRING) {
++static void ppid2sid(zval *ppid TSRMLS_DC) {
++      if (Z_TYPE_P(ppid) != IS_STRING) {
+               PS(id) = NULL;
+               PS(send_cookie) = 1;
+       } else {
 -              convert_to_string((*ppid));
 -              PS(id) = estrndup(Z_STRVAL_PP(ppid), Z_STRLEN_PP(ppid));
++              convert_to_string(ppid);
++              PS(id) = STR_INIT(Z_STRVAL_P(ppid), Z_STRLEN_P(ppid), 0);
+               PS(send_cookie) = 0;
+       }
+ }
  
  PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
  {
@@@ -1498,32 -1536,29 +1505,29 @@@ PHPAPI void php_session_start(TSRMLS_D
         * cookie and get variables will be available. */
  
        if (!PS(id)) {
 -              if (PS(use_cookies) && zend_hash_find(&EG(symbol_table), "_COOKIE", sizeof("_COOKIE"), (void **) &data) == SUCCESS &&
 -                              Z_TYPE_PP(data) == IS_ARRAY &&
 -                              zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
 +              if (PS(use_cookies) && (data = zend_hash_str_find(&EG(symbol_table).ht, "_COOKIE", sizeof("_COOKIE") - 1)) &&
 +                              Z_TYPE_P(data) == IS_ARRAY &&
 +                              (ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
                ) {
-                       PPID2SID;
+                       ppid2sid(ppid TSRMLS_CC);
                        PS(apply_trans_sid) = 0;
-                       PS(send_cookie) = 0;
                        PS(define_sid) = 0;
                }
  
                if (!PS(use_only_cookies) && !PS(id) &&
 -                              zend_hash_find(&EG(symbol_table), "_GET", sizeof("_GET"), (void **) &data) == SUCCESS &&
 -                              Z_TYPE_PP(data) == IS_ARRAY &&
 -                              zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
 +                              (data = zend_hash_str_find(&EG(symbol_table).ht, "_GET", sizeof("_GET") - 1)) &&
 +                              Z_TYPE_P(data) == IS_ARRAY &&
 +                              (ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
                ) {
-                       PPID2SID;
-                       PS(send_cookie) = 0;
+                       ppid2sid(ppid TSRMLS_CC);
                }
  
                if (!PS(use_only_cookies) && !PS(id) &&
 -                              zend_hash_find(&EG(symbol_table), "_POST", sizeof("_POST"), (void **) &data) == SUCCESS &&
 -                              Z_TYPE_PP(data) == IS_ARRAY &&
 -                              zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
 +                              (data = zend_hash_str_find(&EG(symbol_table).ht, "_POST", sizeof("_POST") - 1)) &&
 +                              Z_TYPE_P(data) == IS_ARRAY &&
 +                              (ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
                ) {
-                       PPID2SID;
-                       PS(send_cookie) = 0;
+                       ppid2sid(ppid TSRMLS_CC);
                }
        }
  
diff --cc main/rfc1867.c
Simple merge