Skip to content

Commit d7ac39b

Browse files
committed
Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element
1 parent 5c43e0c commit d7ac39b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3920,6 +3920,18 @@ static int zend_jit_escape_if_undef_r0(dasm_State **Dst, int var, uint32_t flags
39203920

39213921
ZEND_ASSERT(opline);
39223922

3923+
if ((opline-1)->opcode != ZEND_FETCH_CONSTANT
3924+
&& (opline-1)->opcode != ZEND_FETCH_LIST_R
3925+
&& ((opline-1)->op1_type & (IS_VAR|IS_TMP_VAR))
3926+
&& !(flags & ZEND_JIT_EXIT_FREE_OP1)) {
3927+
val_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, (opline-1)->op1.var);
3928+
3929+
| IF_NOT_ZVAL_REFCOUNTED val_addr, >2
3930+
| GET_ZVAL_PTR r0, val_addr
3931+
| GC_ADDREF r0
3932+
|2:
3933+
}
3934+
39233935
| LOAD_IP_ADDR (opline - 1)
39243936
| jmp ->trace_escape
39253937
|1:

0 commit comments

Comments
 (0)