diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-10 11:47:35 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-10 11:48:10 +0100 |
commit | 0a2f6c55279c506dad65a6711567107d6aceec2d (patch) | |
tree | 5661941e37143453b729611c5d280673e10ab482 /Zend/zend_execute_API.c | |
parent | b79efec9947a72cdd587356bd0b1b6f9e4c8c27d (diff) | |
download | php-git-0a2f6c55279c506dad65a6711567107d6aceec2d.tar.gz |
Move undefined constant error into get_constant_ex
All the other error conditions are already handled in there, so
this one should be as well.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index de6af0e5d5..a1bae5ea3a 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -557,22 +557,6 @@ ZEND_API zend_bool zend_is_executing(void) /* {{{ */ } /* }}} */ -ZEND_API ZEND_COLD int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result) /* {{{ */ -{ - char *colon; - - if (UNEXPECTED(EG(exception))) { - return FAILURE; - } else if ((colon = (char*)zend_memrchr(ZSTR_VAL(name), ':', ZSTR_LEN(name)))) { - zend_throw_error(NULL, "Undefined class constant '%s'", ZSTR_VAL(name)); - return FAILURE; - } else { - zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(name)); - return FAILURE; - } -} -/* }}} */ - ZEND_API int zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */ { if (Z_TYPE_P(p) == IS_CONSTANT_AST) { @@ -581,10 +565,10 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */ if (ast->kind == ZEND_AST_CONSTANT) { zend_string *name = zend_ast_get_constant_name(ast); zval *zv = zend_get_constant_ex(name, scope, ast->attr); - if (UNEXPECTED(zv == NULL)) { - return zend_use_undefined_constant(name, ast->attr, p); + return FAILURE; } + zval_ptr_dtor_nogc(p); ZVAL_COPY_OR_DUP(p, zv); } else { |