From: Xinchen Hui Date: Fri, 19 Jun 2015 15:05:35 +0000 (+0800) Subject: Better way to fix (Fix bug #69871 (short-circuiting failure with smart_branch)) X-Git-Tag: php-7.0.0alpha2~2^2~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=307c734bede2db829fa1f4dedc3a4d52a8e2381e;p=php Better way to fix (Fix bug #69871 (short-circuiting failure with smart_branch)) --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 0baf735bda..29018de4f7 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5900,25 +5900,8 @@ void zend_compile_short_circuiting(znode *result, zend_ast *ast) /* {{{ */ opline_jmpz->result_type = IS_TMP_VAR; } - zend_compile_expr(&right_node, right_ast); - - if (right_node.op_type == IS_CONST && opnum_jmpz == get_next_op_number(CG(active_op_array)) - 1) { - if ((ast->kind == ZEND_AST_AND && !zend_is_true(&right_node.u.constant)) - || (ast->kind == ZEND_AST_OR && zend_is_true(&right_node.u.constant))) { - CG(active_op_array)->last--; - result->op_type = IS_CONST; - ZVAL_BOOL(&result->u.constant, zend_is_true(&right_node.u.constant)); - } else { - opline_jmpz->opcode = ZEND_BOOL; - zend_make_var_result(result, opline_jmpz); - } - - zval_ptr_dtor(&right_node.u.constant); - return; - } - - opline_jmpz = &CG(active_op_array)->opcodes[opnum_jmpz]; GET_NODE(result, opline_jmpz->result); + zend_compile_expr(&right_node, right_ast); opline_bool = zend_emit_op(NULL, ZEND_BOOL, &right_node, NULL); SET_NODE(opline_bool->result, result);