com php-src: Fixed for master: Zend/zend_compile.c

From: Date: Thu, 17 Mar 2016 13:10:08 +0000
Subject: com php-src: Fixed for master: Zend/zend_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91395@lists.php.net to get a copy of this message
Commit: 910e6dc6b83212bb42328e47c9a71b61014e80d5 Author: Xinchen Hui <laruence@gmail.com> Thu, 17 Mar 2016 21:10:08 +0800 Parents: aef22ac1c1f269e145d1f644e86c41712d8cfa12 Branches: PHP-7.0 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=910e6dc6b83212bb42328e47c9a71b61014e80d5 Log: Fixed for master Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 56da296..1d7cd36 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -611,16 +611,29 @@ static inline void zend_end_loop(int cont_addr) /* {{{ */ void zend_do_free(znode *op1) /* {{{ */ { - if (op1->op_type==IS_TMP_VAR) { - zend_op *opline = get_next_op(CG(active_op_array)); + if (op1->op_type == IS_TMP_VAR) { + zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; + + while (opline->opcode == ZEND_END_SILENCE) { + opline--; + } + + if (opline->result_type == IS_TMP_VAR && opline->result.var == op1->u.op..var) { + if (opline->opcode == ZEND_BOOL || opline->opcode == ZEND_BOOL_NOT) { + return; + } + } + + opline = get_next_op(CG(active_op_array)); opline->opcode = ZEND_FREE; SET_NODE(opline->op1, op1); SET_UNUSED(opline->op2); - } else if (op1->op_type==IS_VAR) { + } else if (op1->op_type == IS_VAR) { zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; - - while (opline->opcode == ZEND_END_SILENCE || opline->opcode == ZEND_EXT_FCALL_END || opline->opcode == ZEND_OP_DATA) { + while (opline->opcode == ZEND_END_SILENCE || + opline->opcode == ZEND_EXT_FCALL_END || + opline->opcode == ZEND_OP_DATA) { opline--; } if (opline->result_type == IS_VAR @@ -650,7 +663,7 @@ void zend_do_free(znode *op1) /* {{{ */ SET_UNUSED(opline->op2); return; } - if (opline->result_type==IS_VAR + if (opline->result_type == IS_VAR && opline->result.var == op1->u.op.var) { if (opline->opcode == ZEND_NEW) { opline->result_type |= EXT_TYPE_UNUSED;

« previous php.cvs (#91395) next »