diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-03-15 19:06:34 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-03-15 19:49:02 +0100 |
commit | 2bba4a0d7f6d5e5712d60bc1cf2119622d837e55 (patch) | |
tree | 8d77cb855c870ba1a1d058703c06eb646bc034d4 /Zend/zend_constants.c | |
parent | f3ab4c1a086b17daad7a8ecf34292fff6b9566ce (diff) | |
download | php-git-2bba4a0d7f6d5e5712d60bc1cf2119622d837e55.tar.gz |
Fix bug #69676
Diffstat (limited to 'Zend/zend_constants.c')
-rw-r--r-- | Zend/zend_constants.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index cedf5fabc1..2f9d29d833 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -327,6 +327,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, size_t const_name_len = name_len - class_name_len - 2; zend_string *constant_name = zend_string_init(colon + 1, const_name_len, 0); zend_string *class_name = zend_string_init(name, class_name_len, 0); + zend_class_constant *c = NULL; zval *ret_constant = NULL; if (zend_string_equals_literal_ci(class_name, "self")) { @@ -355,7 +356,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, ce = zend_fetch_class(class_name, flags); } if (ce) { - zend_class_constant *c = zend_hash_find_ptr(&ce->constants_table, constant_name); + c = zend_hash_find_ptr(&ce->constants_table, constant_name); if (c == NULL) { if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) { zend_throw_error(NULL, "Undefined class constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name)); @@ -380,7 +381,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, } MARK_CONSTANT_VISITED(ret_constant); } - if (UNEXPECTED(zval_update_constant_ex(ret_constant, ce) != SUCCESS)) { + if (UNEXPECTED(zval_update_constant_ex(ret_constant, c->ce) != SUCCESS)) { RESET_CONSTANT_VISITED(ret_constant); ret_constant = NULL; goto failure; |