com php-src: Better way to fix (Fix bug #69871 (short-circuiting failure with smart_branch)): Zend/zend_compile.c
| From: | Xinchen Hui | Date: | Fri, 19 Jun 2015 15:05:35 +0000 |
| Subject: | com php-src: Better way to fix (Fix bug #69871 (short-circuiting failure with smart_branch)): Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87394@lists.php.net to get a copy of this message | ||
Commit: 307c734bede2db829fa1f4dedc3a4d52a8e2381e
Author: Xinchen Hui <laruence@php.net> Fri, 19 Jun 2015 23:05:35 +0800
Parents: 235c7edb8b77981339895782e3ee2bac09e4a6e6
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=307c734bede2db829fa1f4dedc3a4d52a8e2381e
Log:
Better way to fix (Fix bug #69871 (short-circuiting failure with smart_branch))
Bugs:
https://bugs.php.net/69871
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 0baf735..29018de 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);