Skip to content

Commit

Permalink
Tracing JIT: Fixed reference counting when escape because of IS_UNDEF…
Browse files Browse the repository at this point in the history
… element
  • Loading branch information
dstogov committed Nov 1, 2021
1 parent 5c43e0c commit d7ac39b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -3920,6 +3920,18 @@ static int zend_jit_escape_if_undef_r0(dasm_State **Dst, int var, uint32_t flags

ZEND_ASSERT(opline);

if ((opline-1)->opcode != ZEND_FETCH_CONSTANT
&& (opline-1)->opcode != ZEND_FETCH_LIST_R
&& ((opline-1)->op1_type & (IS_VAR|IS_TMP_VAR))
&& !(flags & ZEND_JIT_EXIT_FREE_OP1)) {
val_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, (opline-1)->op1.var);

| IF_NOT_ZVAL_REFCOUNTED val_addr, >2
| GET_ZVAL_PTR r0, val_addr
| GC_ADDREF r0
|2:
}

| LOAD_IP_ADDR (opline - 1)
| jmp ->trace_escape
|1:
Expand Down

0 comments on commit d7ac39b

Please sign in to comment.