1
0
mirror of https://github.com/php/php-src.git synced 2026-04-05 15:12:39 +02:00

Check for no uses before removing result operand

It's possible for there to still be phi uses.
This commit is contained in:
Nikita Popov
2021-09-14 13:20:28 +02:00
parent fa3d603ba2
commit 54bbee96ba

View File

@@ -2191,8 +2191,10 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
if (ssa_op->result_def == var_num) {
if (opline->opcode == ZEND_ASSIGN) {
/* We can't drop the ASSIGN, but we can remove the result. */
opline->result_type = IS_UNUSED;
zend_ssa_remove_result_def(ssa, ssa_op);
if (var->use_chain < 0 && var->phi_use_chain == NULL) {
opline->result_type = IS_UNUSED;
zend_ssa_remove_result_def(ssa, ssa_op);
}
return 0;
}
if (ssa_op->op1_def >= 0