Skip to content

Commit 1b80de9

Browse files
committed
Cleanup conditions
1 parent ff97ba2 commit 1b80de9

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

Zend/zend_compile.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -723,15 +723,7 @@ void zend_do_free(znode *op1) /* {{{ */
723723
}
724724
if (opline->result_type == IS_VAR
725725
&& opline->result.var == op1->u.op.var) {
726-
if (opline->opcode == ZEND_FETCH_R ||
727-
opline->opcode == ZEND_FETCH_DIM_R ||
728-
opline->opcode == ZEND_FETCH_OBJ_R ||
729-
opline->opcode == ZEND_FETCH_STATIC_PROP_R) {
730-
/* It's very rare and useless case. It's better to use
731-
additional FREE opcode and simplify the FETCH handlers
732-
their selves */
733-
zend_emit_op(NULL, ZEND_FREE, op1, NULL);
734-
} else if (opline->opcode == ZEND_FETCH_THIS) {
726+
if (opline->opcode == ZEND_FETCH_THIS) {
735727
opline->opcode = ZEND_NOP;
736728
opline->result_type = IS_UNUSED;
737729
} else {

ext/opcache/Optimizer/zend_inference.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,8 +3290,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
32903290
/* FETCH_LIST on a string behaves like FETCH_R on null */
32913291
tmp = zend_array_element_type(
32923292
opline->opcode != ZEND_FETCH_LIST_R ? t1 : ((t1 & ~MAY_BE_STRING) | MAY_BE_NULL),
3293-
opline->opcode != ZEND_FETCH_DIM_R && opline->opcode != ZEND_FETCH_DIM_IS
3294-
&& opline->opcode != ZEND_FETCH_LIST_R,
3293+
opline->result_type == IS_VAR,
32953294
opline->op2_type == IS_UNUSED);
32963295
if (opline->opcode == ZEND_FETCH_DIM_W ||
32973296
opline->opcode == ZEND_FETCH_DIM_RW ||
@@ -3336,7 +3335,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
33363335
}
33373336
if (ssa_ops[i].result_def >= 0) {
33383337
tmp = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
3339-
if (opline->opcode == ZEND_FETCH_OBJ_R || opline->opcode == ZEND_FETCH_OBJ_IS) {
3338+
if (opline->result_type == IS_TMP_VAR) {
33403339
/* can't be REF because of ZVAL_COPY_DEREF() usage */
33413340
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
33423341
} else {
@@ -3442,14 +3441,6 @@ static int zend_update_type_info(const zend_op_array *op_array,
34423441
/* Forbidden opcodes */
34433442
ZEND_ASSERT(0);
34443443
break;
3445-
case ZEND_FETCH_R:
3446-
case ZEND_FETCH_IS:
3447-
case ZEND_FETCH_STATIC_PROP_R:
3448-
case ZEND_FETCH_STATIC_PROP_IS:
3449-
/* can't be REF because of ZVAL_COPY_DEREF() usage */
3450-
tmp = MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
3451-
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
3452-
break;
34533444
default:
34543445
unknown_opcode:
34553446
if (ssa_ops[i].op1_def >= 0) {

0 commit comments

Comments
 (0)