Skip to content

Commit f9f6123

Browse files
committed
Fix verify type jit for complex type masks
We should not try to check things like MAY_BE_CALLABLE in the fast path, because those aren't real types. This is only actively wrong for the concrete_type case, for the mask case it just uses an unnecessarily large immediate.
1 parent e0aa272 commit f9f6123

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10891,7 +10891,7 @@ static int zend_jit_verify_arg_type(dasm_State **Dst, const zend_op *opline, zen
1089110891
{
1089210892
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
1089310893
zend_bool in_cold = 0;
10894-
uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type);
10894+
uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type) & MAY_BE_ANY;
1089510895
zend_reg tmp_reg = (type_mask == 0 || is_power_of_two(type_mask)) ? ZREG_FCARG1a : ZREG_R0;
1089610896

1089710897
if (ZEND_ARG_SEND_MODE(arg_info)) {
@@ -12029,7 +12029,7 @@ static zend_bool zend_jit_verify_return_type(dasm_State **Dst, const zend_op *op
1202912029

1203012030
| LOAD_ZVAL_ADDR r0, op1_addr
1203112031

12032-
uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type);
12032+
uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type) & MAY_BE_ANY;
1203312033
if (type_mask == 0) {
1203412034
| jmp >7
1203512035
} else if (is_power_of_two(type_mask)) {

0 commit comments

Comments
 (0)