Skip to content

Commit 52dab23

Browse files
committed
Fix FFI scope reference counting during FFI call
1 parent 247927e commit 52dab23

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/opcache/jit/zend_jit_ir_ffi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ static int zend_jit_ffi_init_call_sym(zend_jit_ctx *jit,
6666
return 0;
6767
}
6868

69+
if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) {
70+
// TODO: usually the object is released only after the call ???
71+
jit_GC_DELREF(jit, jit_Z_PTR(jit, op1_addr));
72+
}
73+
6974
if (type->func.abi == ZEND_FFI_ABI_FASTCALL) {
7075
*ffi_func_ref = ir_CONST_FC_FUNC(sym->addr);
7176
} else {

0 commit comments

Comments
 (0)