Skip to content

Commit 7764d05

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: JIT: Fixed possible memory leak
2 parents 5c13587 + b9f12d6 commit 7764d05

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,12 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
656656
default:
657657
zend_jit_illegal_offset();
658658
undef_result_after_exception();
659+
if ((EG(opline_before_exception)+1)->opcode == ZEND_OP_DATA
660+
&& ((EG(opline_before_exception)+1)->op1_type & (IS_VAR|IS_TMP_VAR))) {
661+
zend_execute_data *execute_data = EG(current_execute_data);
662+
663+
zval_ptr_dtor_nogc(EX_VAR((EG(opline_before_exception)+1)->op1.var));
664+
}
659665
return NULL;
660666
}
661667

0 commit comments

Comments
 (0)