Skip to content

Commit bbcf77c

Browse files
committed
Fix some block_pass bugs
1 parent 1a30a7a commit bbcf77c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/opcache/Optimizer/block_pass.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
10601060
literal_dtor(&ZEND_OP1_LITERAL(opline));
10611061
} else {
10621062
/* BOOL */
1063-
result = ZEND_OP1_LITERAL(opline);
1063+
ZVAL_COPY_VALUE(&result, &ZEND_OP1_LITERAL(opline));
10641064
convert_to_boolean(&result);
10651065
ZVAL_NULL(&ZEND_OP1_LITERAL(opline));
10661066
}
@@ -1921,11 +1921,12 @@ static void zend_t_usage(zend_code_block *block, zend_op_array *op_array, zend_b
19211921
case ZEND_QM_ASSIGN:
19221922
case ZEND_BOOL:
19231923
case ZEND_BOOL_NOT:
1924-
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
1925-
literal_dtor(&ZEND_OP1_LITERAL(opline));
1926-
} else if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR) {
1924+
if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR) {
19271925
opline->opcode = ZEND_FREE;
19281926
} else {
1927+
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
1928+
literal_dtor(&ZEND_OP1_LITERAL(opline));
1929+
}
19291930
MAKE_NOP(opline);
19301931
}
19311932
break;

0 commit comments

Comments
 (0)