1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00

Result of ASSIGN may be different from the assigned value when LHS is a typed reference

This commit is contained in:
Dmitry Stogov
2020-03-18 01:40:41 +03:00
parent a8e8c40ad4
commit f767807986
+4 -1
View File
@@ -2711,7 +2711,10 @@ done:
type = STACK_VAR_TYPE(opline->op1.var);
}
} else if (opline->opcode == ZEND_ASSIGN) {
if (opline->op2_type != IS_CONST) {
if (opline->op2_type != IS_CONST
&& ssa_op->op1_use >= 0
/* assignment to typed reference may cause conversion */
&& (ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF) == 0) {
/* copy */
type = STACK_VAR_TYPE(opline->op2.var);
}