diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-13 09:51:29 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-13 09:53:25 +0200 |
commit | 18f2918a0fcf66562a5e7d964188c188660e9728 (patch) | |
tree | 5a4c84a27d1d79df45f21ebcd22a25869745bab3 | |
parent | f3fdf570b3cd3df14af3d698950d341623a97088 (diff) | |
download | php-git-18f2918a0fcf66562a5e7d964188c188660e9728.tar.gz |
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.
-rw-r--r-- | Zend/zend_objects.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index 11daa0646a..7a93c1bdb1 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -46,7 +46,8 @@ ZEND_API void zend_object_std_dtor(zend_object *object) if (object->properties) { if (EXPECTED(!(GC_FLAGS(object->properties) & IS_ARRAY_IMMUTABLE))) { - if (EXPECTED(--GC_REFCOUNT(object->properties) == 0)) { + if (EXPECTED(--GC_REFCOUNT(object->properties) == 0) + && EXPECTED(GC_TYPE(object->properties) != IS_NULL)) { zend_array_destroy(object->properties); } } |