Created
December 20, 2016 11:44
-
-
Save laruence/54ad3436af0f46aac8f8009f25558d49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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