Skip to content

Commit 971b07e

Browse files
committed
JIT: Fix incorrect reference-counting
This fixes oss-fuzz #47937
1 parent 70e0e1a commit 971b07e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/opcache/jit/zend_jit_helpers.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
811811
opline = EX(opline);
812812
zend_incompatible_double_to_long_error(Z_DVAL_P(dim));
813813
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && GC_DELREF(ht) != 1) {
814-
if (GC_REFCOUNT(ht)) {
814+
if (!GC_REFCOUNT(ht)) {
815815
zend_array_destroy(ht);
816816
}
817817
if (opline->result_type & (IS_VAR | IS_TMP_VAR)) {
@@ -841,7 +841,7 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
841841
opline = EX(opline);
842842
zend_use_resource_as_offset(dim);
843843
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && GC_DELREF(ht) != 1) {
844-
if (GC_REFCOUNT(ht)) {
844+
if (!GC_REFCOUNT(ht)) {
845845
zend_array_destroy(ht);
846846
}
847847
if (opline->result_type & (IS_VAR | IS_TMP_VAR)) {

0 commit comments

Comments
 (0)