Skip to content

Commit f91283f

Browse files
committed
Fixed JIT for ext/opcache/tests/bool_not_cv.phpt with opcache.jit=1202
1 parent 0bff4e5 commit f91283f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7224,6 +7224,7 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, const z
72247224
uint32_t false_label = -1;
72257225
zend_bool set_bool = 0;
72267226
zend_bool set_bool_not = 0;
7227+
zend_bool set_delayed = 0;
72277228
zend_bool jmp_done = 0;
72287229

72297230
if (branch_opcode == ZEND_BOOL) {
@@ -7393,15 +7394,25 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, const z
73937394
} else {
73947395
| add eax, 2
73957396
}
7396-
| SET_ZVAL_TYPE_INFO res_addr, eax
7397+
if ((op1_info & MAY_BE_UNDEF) && (op1_info & MAY_BE_ANY)) {
7398+
set_delayed = 1;
7399+
} else {
7400+
| SET_ZVAL_TYPE_INFO res_addr, eax
7401+
}
73977402
}
73987403
}
73997404
}
74007405

74017406
/* It's FALSE, but may be UNDEF */
74027407
if (op1_info & MAY_BE_UNDEF) {
74037408
if (op1_info & MAY_BE_ANY) {
7404-
| IF_ZVAL_TYPE op1_addr, IS_UNDEF, >1
7409+
if (set_delayed) {
7410+
| CMP_ZVAL_TYPE op1_addr, IS_UNDEF
7411+
| SET_ZVAL_TYPE_INFO res_addr, eax
7412+
| jz >1
7413+
} else {
7414+
| IF_ZVAL_TYPE op1_addr, IS_UNDEF, >1
7415+
}
74057416
|.cold_code
74067417
|1:
74077418
}

0 commit comments

Comments
 (0)