summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-12-11 12:29:10 +0300
committerDmitry Stogov <dmitry@zend.com>2019-12-11 12:29:10 +0300
commitee45dbab377ef733abfea937f5e8356d6f8c209b (patch)
tree5c4fa83de57fd23a8637c5a44f26d889fb6fd2dd /Zend/zend_API.c
parent8fb3ef6e3784d9f07e688cea4571ab42dfaa8895 (diff)
parent3280209c0312df000d558e029aa4e8c63912967a (diff)
downloadphp-git-ee45dbab377ef733abfea937f5e8356d6f8c209b.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Addirional fix for bug #78918
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index e58e331773..7d16e376c3 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2581,6 +2581,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) {
@@ -2598,9 +2599,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++;
}