Skip to content

Commit b6d138f

Browse files
committed
Merge branch 'PHP-7.4'
2 parents 04c45ed + 4226c82 commit b6d138f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Zend/zend_compile.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,7 +2799,7 @@ void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */
27992799

28002800
znode target_node, source_node;
28012801
zend_op *opline;
2802-
uint32_t offset;
2802+
uint32_t offset, flags;
28032803

28042804
if (is_this_fetch(target_ast)) {
28052805
zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this");
@@ -2828,27 +2828,27 @@ void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */
28282828
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use result of built-in function in write context");
28292829
}
28302830

2831+
flags = zend_is_call(source_ast) ? ZEND_RETURNS_FUNCTION : 0;
2832+
28312833
if (opline && opline->opcode == ZEND_FETCH_OBJ_W) {
28322834
opline->opcode = ZEND_ASSIGN_OBJ_REF;
28332835
opline->extended_value &= ~ZEND_FETCH_REF;
2836+
opline->extended_value |= flags;
28342837
zend_emit_op_data(&source_node);
28352838
if (result != NULL) {
28362839
*result = target_node;
28372840
}
28382841
} else if (opline && opline->opcode == ZEND_FETCH_STATIC_PROP_W) {
28392842
opline->opcode = ZEND_ASSIGN_STATIC_PROP_REF;
28402843
opline->extended_value &= ~ZEND_FETCH_REF;
2844+
opline->extended_value |= flags;
28412845
zend_emit_op_data(&source_node);
28422846
if (result != NULL) {
28432847
*result = target_node;
28442848
}
28452849
} else {
28462850
opline = zend_emit_op(result, ZEND_ASSIGN_REF, &target_node, &source_node);
2847-
opline->extended_value = 0;
2848-
}
2849-
2850-
if (zend_is_call(source_ast)) {
2851-
opline->extended_value |= ZEND_RETURNS_FUNCTION;
2851+
opline->extended_value = flags;
28522852
}
28532853
}
28542854
/* }}} */

0 commit comments

Comments
 (0)