summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-07-24 22:03:05 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-07-24 22:04:05 +0200
commit7ca85d8875b13b15f124036a07c073f1993979a2 (patch)
tree34d717019900f07f9f58a74083eddd7e3f36618f /Zend/zend_opcode.c
parentfa4cd519e6a5350d2b17d2fc1637a890dcfb7acb (diff)
downloadphp-git-7ca85d8875b13b15f124036a07c073f1993979a2.tar.gz
Fully fix typed generator returns
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index c42f3807e4..da401e17b9 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -693,7 +693,6 @@ static void zend_resolve_finally_calls(zend_op_array *op_array)
break;
case ZEND_GOTO:
if (Z_TYPE_P(CT_CONSTANT_EX(op_array, opline->op2.constant)) != IS_LONG) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op2);
zend_resolve_goto_label(op_array, NULL, opline);
}
/* break omitted intentionally */
@@ -744,19 +743,6 @@ ZEND_API int pass_two(zend_op_array *op_array)
opline = op_array->opcodes;
end = opline + op_array->last;
while (opline < end) {
- if (opline->op1_type == IS_CONST) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op1);
- } else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
- opline->op1.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op1.var);
- }
- if (opline->op2_type == IS_CONST) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op2);
- } else if (opline->op2_type & (IS_VAR|IS_TMP_VAR)) {
- opline->op2.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op2.var);
- }
- if (opline->result_type & (IS_VAR|IS_TMP_VAR)) {
- opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->result.var);
- }
switch (opline->opcode) {
case ZEND_DECLARE_ANON_INHERITED_CLASS:
ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op1);
@@ -776,7 +762,7 @@ ZEND_API int pass_two(zend_op_array *op_array)
}
break;
case ZEND_GOTO:
- if (Z_TYPE_P(RT_CONSTANT(op_array, opline->op2)) != IS_LONG) {
+ if (Z_TYPE_P(CT_CONSTANT_EX(op_array, opline->op2.constant)) != IS_LONG) {
zend_resolve_goto_label(op_array, NULL, opline);
}
/* break omitted intentionally */
@@ -821,6 +807,19 @@ ZEND_API int pass_two(zend_op_array *op_array)
}
break;
}
+ if (opline->op1_type == IS_CONST) {
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op1);
+ } else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
+ opline->op1.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op1.var);
+ }
+ if (opline->op2_type == IS_CONST) {
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op2);
+ } else if (opline->op2_type & (IS_VAR|IS_TMP_VAR)) {
+ opline->op2.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op2.var);
+ }
+ if (opline->result_type & (IS_VAR|IS_TMP_VAR)) {
+ opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->result.var);
+ }
ZEND_VM_SET_OPCODE_HANDLER(opline);
opline++;
}