From: Dmitry Stogov Date: Tue, 22 Jul 2014 11:42:17 +0000 (+0400) Subject: Merge branch 'master' into phpng X-Git-Tag: POST_PHPNG_MERGE~47^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2a2fcceceed5bb5851b459af9383d0da14a804b;p=php Merge branch 'master' into phpng * 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 --- f2a2fcceceed5bb5851b459af9383d0da14a804b diff --cc Zend/zend_compile.h index a838a58144,f86a41ae2b..4c28be91f3 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@@ -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" diff --cc Zend/zend_opcode.c index 2f0f0aeecd,bff314ef65..8309599521 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@@ -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; } diff --cc Zend/zend_vm_def.h index 4b8f229c8d,bff84db922..48ad78915d --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@@ -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 { diff --cc Zend/zend_vm_execute.h index d5bdb70762,0151ea0684..df1731f177 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@@ -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 { diff --cc ext/session/session.c index fdd6b1696a,b24e6365f1..ff04462ca4 --- a/ext/session/session.c +++ b/ext/session/session.c @@@ -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); } }