Skip to content

Commit 52069f6

Browse files
committed
Check for undef in recv jit
Rather than checking the argument count
1 parent 718e089 commit 52069f6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10973,17 +10973,17 @@ static int zend_jit_recv(dasm_State **Dst, const zend_op *opline, const zend_op_
1097310973
}
1097410974

1097510975
if (arg_info || (opline+1)->opcode != ZEND_RECV) {
10976-
| cmp dword EX->This.u2.num_args, arg_num
10976+
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
1097710977
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
1097810978
int32_t exit_point = zend_jit_trace_get_exit_point(opline, opline, NULL, ZEND_JIT_EXIT_TO_VM);
1097910979
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
1098010980

1098110981
if (!exit_addr) {
1098210982
return 0;
1098310983
}
10984-
| jb &exit_addr
10984+
| IF_ZVAL_TYPE res_addr, IS_UNDEF, &exit_addr
1098510985
} else {
10986-
| jb >1
10986+
| IF_ZVAL_TYPE res_addr, IS_UNDEF, >1
1098710987
|.cold_code
1098810988
|1:
1098910989
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
@@ -11025,8 +11025,7 @@ static int zend_jit_recv_init(dasm_State **Dst, const zend_op *opline, const zen
1102511025

1102611026
if (JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE ||
1102711027
(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
11028-
| cmp dword EX->This.u2.num_args, arg_num
11029-
| jae >5
11028+
| IF_NOT_ZVAL_TYPE res_addr, IS_UNDEF, >5
1103011029
}
1103111030
| ZVAL_COPY_CONST res_addr, -1, -1, zv, r0
1103211031
if (Z_REFCOUNTED_P(zv)) {

0 commit comments

Comments
 (0)