From 3280209c0312df000d558e029aa4e8c63912967a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 11 Dec 2019 12:21:49 +0300 Subject: Addirional fix for bug #78918 --- Zend/zend_API.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Zend/zend_API.c') diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 3493a241a6..21d2c964e8 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2762,6 +2762,7 @@ ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *or ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zend_class_entry *ce, int persistent) /* {{{ */ { zend_string *lcname; + zval zv, *ret; /* TODO: Move this out of here in 7.4. */ if (persistent && EG(current_module) && EG(current_module)->type == MODULE_TEMPORARY) { @@ -2779,9 +2780,11 @@ ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zen zend_assert_valid_class_name(lcname); lcname = zend_new_interned_string(lcname); - ce = zend_hash_add_ptr(CG(class_table), lcname, ce); + + ZVAL_ALIAS_PTR(&zv, ce); + ret = zend_hash_add(CG(class_table), lcname, &zv); zend_string_release_ex(lcname, 0); - if (ce) { + if (ret) { if (!(ce->ce_flags & ZEND_ACC_IMMUTABLE)) { ce->refcount++; } -- cgit v1.2.1