Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/ext/opcache/Optimizer/dfa_pass.c b/ext/opcache/Optimizer/dfa_pass.c
index b7a0f06..2780a4c 100644
--- a/ext/opcache/Optimizer/dfa_pass.c
+++ b/ext/opcache/Optimizer/dfa_pass.c
@@ -569,19 +569,23 @@ void zend_dfa_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *ctx
// op_1: VERIFY_RETURN_TYPE #orig_var.CV [T] -> #v.CV [T] => NOP
int orig_var = ssa->ops[op_1].op1_use;
- int ret = ssa->vars[v].use_chain;
+ if (zend_ssa_unlink_use_chain(ssa, op_1, orig_var)) {
- ssa->vars[orig_var].use_chain = ret;
- ssa->ops[ret].op1_use = orig_var;
+ int ret = ssa->vars[v].use_chain;
- ssa->vars[v].definition = -1;
- ssa->vars[v].use_chain = -1;
+ ssa->ops[ret].op1_use = orig_var;
+ ssa->ops[ret].op1_use_chain = ssa->vars[orig_var].use_chain;
+ ssa->vars[orig_var].use_chain = ret;
- ssa->ops[op_1].op1_def = -1;
- ssa->ops[op_1].op1_use = -1;
+ ssa->vars[v].definition = -1;
+ ssa->vars[v].use_chain = -1;
+
+ ssa->ops[op_1].op1_def = -1;
+ ssa->ops[op_1].op1_use = -1;
- MAKE_NOP(opline);
- remove_nops = 1;
+ MAKE_NOP(opline);
+ remove_nops = 1;
+ }
} else if (ssa->ops[op_1].op1_def == v
&& !RETURN_VALUE_USED(opline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.