mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Proper SSA reconstruction for "$a = $a;"
This commit is contained in:
parent
4872d139b5
commit
d1eb5ede3a
1 changed files with 21 additions and 17 deletions
|
@ -608,7 +608,12 @@ void zend_dfa_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *ctx
|
||||||
|
|
||||||
// op_1: ASSIGN #orig_var.CV [undef,scalar] -> #v.CV, CONST|TMPVAR => QM_ASSIGN v.CV, CONST|TMPVAR
|
// op_1: ASSIGN #orig_var.CV [undef,scalar] -> #v.CV, CONST|TMPVAR => QM_ASSIGN v.CV, CONST|TMPVAR
|
||||||
|
|
||||||
if (zend_ssa_unlink_use_chain(ssa, op_1, orig_var)) {
|
if (ssa->ops[op_1].op1_use != ssa->ops[op_1].op2_use) {
|
||||||
|
ZEND_ASSERT(zend_ssa_unlink_use_chain(ssa, op_1, orig_var));
|
||||||
|
} else {
|
||||||
|
ssa->ops[op_1].op2_use_chain = ssa->ops[op_1].op1_use_chain;
|
||||||
|
}
|
||||||
|
|
||||||
/* Reconstruct SSA */
|
/* Reconstruct SSA */
|
||||||
ssa->ops[op_1].result_def = v;
|
ssa->ops[op_1].result_def = v;
|
||||||
ssa->ops[op_1].op1_def = -1;
|
ssa->ops[op_1].op1_def = -1;
|
||||||
|
@ -627,7 +632,6 @@ void zend_dfa_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *ctx
|
||||||
opline->opcode = ZEND_QM_ASSIGN;
|
opline->opcode = ZEND_QM_ASSIGN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
} else if (opline->opcode == ZEND_ASSIGN_ADD
|
} else if (opline->opcode == ZEND_ASSIGN_ADD
|
||||||
&& opline->extended_value == 0
|
&& opline->extended_value == 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue