Merge branch 'PHP-7.3' into PHP-7.4

This commit is contained in:
Nikita Popov 2019-03-01 14:35:26 +01:00
commit df93506f56
2 changed files with 9 additions and 6 deletions

View file

@ -123,8 +123,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
/* always free the CV's, in the symtable are only not-free'd IS_INDIRECT's */ /* always free the CV's, in the symtable are only not-free'd IS_INDIRECT's */
zend_free_compiled_variables(execute_data); zend_free_compiled_variables(execute_data);
if ((EX_CALL_INFO() & ZEND_CALL_RELEASE_THIS) && if (EX_CALL_INFO() & ZEND_CALL_RELEASE_THIS) {
EXPECTED(GC_TYPE(Z_OBJ(execute_data->This)) == IS_OBJECT)) {
OBJ_RELEASE(Z_OBJ(execute_data->This)); OBJ_RELEASE(Z_OBJ(execute_data->This));
} }
@ -144,8 +143,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
} }
/* Free closure object */ /* Free closure object */
if ((EX_CALL_INFO() & ZEND_CALL_CLOSURE) && if (EX_CALL_INFO() & ZEND_CALL_CLOSURE) {
EXPECTED(GC_TYPE(ZEND_CLOSURE_OBJECT(EX(func))) == IS_OBJECT)) {
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func))); OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
} }

View file

@ -158,12 +158,17 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_put(zend_object *object)
ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ */ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ */
{ {
ZEND_ASSERT(GC_REFCOUNT(object) == 0);
/* GC might have released this object already. */
if (UNEXPECTED(GC_TYPE(object) == IS_NULL)) {
return;
}
/* Make sure we hold a reference count during the destructor call /* Make sure we hold a reference count during the destructor call
otherwise, when the destructor ends the storage might be freed otherwise, when the destructor ends the storage might be freed
when the refcount reaches 0 a second time when the refcount reaches 0 a second time
*/ */
ZEND_ASSERT(GC_REFCOUNT(object) == 0);
if (!(OBJ_FLAGS(object) & IS_OBJ_DESTRUCTOR_CALLED)) { if (!(OBJ_FLAGS(object) & IS_OBJ_DESTRUCTOR_CALLED)) {
GC_ADD_FLAGS(object, IS_OBJ_DESTRUCTOR_CALLED); GC_ADD_FLAGS(object, IS_OBJ_DESTRUCTOR_CALLED);