summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 656d3758f7..f9c5305f50 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1436,7 +1436,9 @@ void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initia
if (class_type->op_type != IS_UNUSED) {
cur_arg_info->allow_null = 0;
if (Z_TYPE(class_type->u.constant) == IS_STRING || Z_TYPE(class_type->u.constant) == IS_UNICODE) {
- zend_resolve_class_name(class_type, &opline->extended_value, 1 TSRMLS_CC);
+ if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_TYPE(class_type->u.constant), Z_UNIVAL(class_type->u.constant), Z_UNILEN(class_type->u.constant))) {
+ zend_resolve_class_name(class_type, &opline->extended_value, 1 TSRMLS_CC);
+ }
cur_arg_info->class_name = Z_UNIVAL(class_type->u.constant);
cur_arg_info->class_name_len = Z_UNILEN(class_type->u.constant);
if (op == ZEND_RECV_INIT) {
@@ -1665,6 +1667,9 @@ void zend_resolve_class_name(znode *class_name, ulong *fetch_type, int check_ns_
Z_USTRVAL(class_name->u.constant) = eurealloc(
Z_USTRVAL(class_name->u.constant),
Z_USTRLEN(class_name->u.constant) + 1);
+ if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type(Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant), Z_UNILEN(class_name->u.constant))) {
+ zend_error(E_COMPILE_ERROR, "'::%R' is a wrong class name", Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant));
+ }
} else if (Z_TYPE(class_name->u.constant) == IS_STRING &&
Z_STRVAL(class_name->u.constant)[0] == ':') {
/* The STRING name has "::" prefix */
@@ -1673,6 +1678,9 @@ void zend_resolve_class_name(znode *class_name, ulong *fetch_type, int check_ns_
Z_STRVAL(class_name->u.constant) = erealloc(
Z_STRVAL(class_name->u.constant),
Z_STRLEN(class_name->u.constant) + 1);
+ if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type(Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant), Z_UNILEN(class_name->u.constant))) {
+ zend_error(E_COMPILE_ERROR, "'::%R' is a wrong class name", Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant));
+ }
} else if (CG(current_import)) {
if (Z_TYPE(class_name->u.constant) == IS_UNICODE) {
len = compound.u - Z_USTRVAL(class_name->u.constant);