summaryrefslogtreecommitdiff
path: root/ext/opcache/Optimizer/zend_dump.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-05-22 00:05:06 +0200
committerNikita Popov <nikic@php.net>2016-05-22 00:05:06 +0200
commit0d62dfdf81fb7710c20a46a75ad6166e25e50a12 (patch)
tree89e71806c85826bcad74047c4392791097c3e165 /ext/opcache/Optimizer/zend_dump.c
parentfa9566627be5ea2a15a29643e6c652a22adba5e2 (diff)
downloadphp-git-0d62dfdf81fb7710c20a46a75ad6166e25e50a12.tar.gz
Improve previous fix
Do not mark loop var free blocks as reachable after all -- as we can't construct SSA for unreachable blocks, this would cause issues down the line. Instead add an extra UNREACHABLE_FREE flag and retain only the FREE instruction during NOP removal. (If we retain all instructions in the BB we might leave a jump instruction that goes into the nowhere.)
Diffstat (limited to 'ext/opcache/Optimizer/zend_dump.c')
-rw-r--r--ext/opcache/Optimizer/zend_dump.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c
index 986e470345..70abe4d317 100644
--- a/ext/opcache/Optimizer/zend_dump.c
+++ b/ext/opcache/Optimizer/zend_dump.c
@@ -399,9 +399,8 @@ static void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *
if (!ssa || !ssa->ops || ssa->ops[opline - op_array->opcodes].result_use < 0) {
if (opline->result_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
- if (ssa && ssa->ops) {
+ if (ssa && ssa->ops && ssa->ops[opline - op_array->opcodes].result_def >= 0) {
int ssa_var_num = ssa->ops[opline - op_array->opcodes].result_def;
- ZEND_ASSERT(ssa_var_num >= 0);
zend_dump_ssa_var(op_array, ssa, ssa_var_num, opline->result_type, EX_VAR_TO_NUM(opline->result.var), dump_flags);
} else {
zend_dump_var(op_array, opline->result_type, EX_VAR_TO_NUM(opline->result.var));