com php-src: Merge branch 'master' into phpng: Zend/zend_comp ile.h Zend/zend_opcode.c Zend/zend_vm_def.h Z end/zend_vm_execute.h
ext/session/session.c main/rf c1867.c
| From: | Dmitry Stogov | Date: | Tue, 22 Jul 2014 11:42:17 +0000 |
| Subject: | com php-src: Merge branch 'master' into phpng: Zend/zend_comp ile.h Zend/zend_opcode.c Zend/zend_vm_def.h Z end/zend_vm_execute.h ext/session/session.c main/rf c1867.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79549@lists.php.net to get a copy of this message | ||
Commit: f2a2fcceceed5bb5851b459af9383d0da14a804b
Author: Dmitry Stogov <dmitry@zend.com> Tue, 22 Jul 2014 15:42:17 +0400
Parents: 821b8bbb397a70151bdd039c072757e0f12fad19 b39f98cf81cce1eae9f665a5c7f82c93e218a577
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f2a2fcceceed5bb5851b459af9383d0da14a804b
Log:
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
Bugs:
https://bugs.php.net/67635
https://bugs.php.net/66608
https://bugs.php.net/66827
Changed paths:
MM Zend/zend_compile.h
MM Zend/zend_opcode.c
MM Zend/zend_vm_def.h
MM Zend/zend_vm_execute.h
MM ext/session/session.c
MM main/rfc1867.c
Diff:
diff --cc Zend/zend_compile.h
index a838a58,f86a41a..4c28be9
--- 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 2f0f0ae,bff314e..8309599
--- 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 4b8f229,bff84db..48ad789
--- 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 d5bdb70,0151ea0..df1731f
--- 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 fdd6b16,b24e636..ff04462
--- 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);
}
}