Skip to content

Commit

Permalink
Sync JIT overloaded assign/inc/dec overloaded property
Browse files Browse the repository at this point in the history
We should only release the read_property return value if
retval is used, same as in zend_execute.c. This fixes a test
failure under PROFITABILITY_CHECKS=0.
  • Loading branch information
nikic committed Jul 21, 2021
1 parent a190c7f commit a3f5b11
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions ext/opcache/jit/zend_jit_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,9 @@ static zend_never_inline void _zend_jit_assign_op_overloaded_property(zend_objec
//??? if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
//??? ZVAL_COPY(EX_VAR(opline->result.var), &res);
//??? }
zval_ptr_dtor(z);
if (z == &rv) {
zval_ptr_dtor(z);
}
zval_ptr_dtor(&res);
OBJ_RELEASE(object);
}
Expand Down Expand Up @@ -2361,7 +2363,9 @@ static void ZEND_FASTCALL zend_jit_pre_inc_obj_helper(zend_object *zobj, zend_st
zobj->handlers->write_property(zobj, name, &z_copy, cache_slot);
OBJ_RELEASE(zobj);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
if (z == &rv) {
zval_ptr_dtor(z);
}
}
}

Expand Down Expand Up @@ -2430,7 +2434,9 @@ static void ZEND_FASTCALL zend_jit_pre_dec_obj_helper(zend_object *zobj, zend_st
zobj->handlers->write_property(zobj, name, &z_copy, cache_slot);
OBJ_RELEASE(zobj);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
if (z == &rv) {
zval_ptr_dtor(z);
}
}
}

Expand Down Expand Up @@ -2489,7 +2495,9 @@ static void ZEND_FASTCALL zend_jit_post_inc_obj_helper(zend_object *zobj, zend_s
zobj->handlers->write_property(zobj, name, &z_copy, cache_slot);
OBJ_RELEASE(zobj);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
if (z == &rv) {
zval_ptr_dtor(z);
}
}
}

Expand Down Expand Up @@ -2548,7 +2556,9 @@ static void ZEND_FASTCALL zend_jit_post_dec_obj_helper(zend_object *zobj, zend_s
zobj->handlers->write_property(zobj, name, &z_copy, cache_slot);
OBJ_RELEASE(zobj);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
if (z == &rv) {
zval_ptr_dtor(z);
}
}
}

Expand Down

0 comments on commit a3f5b11

Please sign in to comment.