cvs: ZendEngine2(PHP_5_3) / zend_compile.c /tests bug43332_1.phpt bug43332_2.phpt

From: Date: Mon, 03 Dec 2007 14:15:43 +0000
Subject: cvs: ZendEngine2(PHP_5_3) / zend_compile.c /tests bug43332_1.phpt bug43332_2.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6216@lists.php.net to get a copy of this message
dmitry Mon Dec 3 14:15:43 2007 UTC Added files: (Branch: PHP_5_3) /ZendEngine2/tests bug43332_1.phpt bug43332_2.phpt Modified files: /ZendEngine2 zend_compile.c Log: Fixed bug #43332 (self and parent as type hint in namespace) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.41.2.26&r2=1.647.2.27.2.41.2.27&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.26 ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.27 --- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.26 Thu Nov 22 13:27:11 2007 +++ ZendEngine2/zend_compile.c Mon Dec 3 14:15:42 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.26 2007/11/22 13:27:11 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.27 2007/12/03 14:15:42 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -1342,7 +1342,9 @@ if (class_type->op_type != IS_UNUSED) { cur_arg_info->allow_null = 0; if (class_type->u.constant.type == IS_STRING) { - zend_resolve_class_name(class_type, &opline->extended_value, 1 TSRMLS_CC); + if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant))) { + zend_resolve_class_name(class_type, &opline->extended_value, 1 TSRMLS_CC); + } cur_arg_info->class_name = class_type->u.constant.value.str.val; cur_arg_info->class_name_len = class_type->u.constant.value.str.len; if (op == ZEND_RECV_INIT) { @@ -1542,6 +1544,10 @@ 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_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { + zend_error(E_COMPILE_ERROR, "'::%s' is a wrong class name", Z_STRVAL(class_name->u.constant)); + } } else if (CG(current_import)) { len = compound - Z_STRVAL(class_name->u.constant); lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), len); http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug43332_1.phpt?view=markup&rev=1.1 Index: ZendEngine2/tests/bug43332_1.phpt +++ ZendEngine2/tests/bug43332_1.phpt http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug43332_2.phpt?view=markup&rev=1.1 Index: ZendEngine2/tests/bug43332_2.phpt +++ ZendEngine2/tests/bug43332_2.phpt

« previous php.zend-engine.cvs (#6216) next »