Skip to content

Commit 18f2918

Browse files
committed
Don't destroy properties array with unset GC type
As the properties array can also be a GC root, it might have already been destroyed.
1 parent f3fdf57 commit 18f2918

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Zend/zend_objects.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ ZEND_API void zend_object_std_dtor(zend_object *object)
4646

4747
if (object->properties) {
4848
if (EXPECTED(!(GC_FLAGS(object->properties) & IS_ARRAY_IMMUTABLE))) {
49-
if (EXPECTED(--GC_REFCOUNT(object->properties) == 0)) {
49+
if (EXPECTED(--GC_REFCOUNT(object->properties) == 0)
50+
&& EXPECTED(GC_TYPE(object->properties) != IS_NULL)) {
5051
zend_array_destroy(object->properties);
5152
}
5253
}

0 commit comments

Comments
 (0)