cvs: ZendEngine2 / zend_compile.c
| From: | Dmitry Stogov | Date: | Wed, 22 Feb 2006 10:56:52 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4610@lists.php.net to get a copy of this message | ||
dmitry Wed Feb 22 10:56:52 2006 UTC
Modified files:
/ZendEngine2 zend_compile.c
Log:
Unicode support: fixed check for class type hint
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_compile.c?r1=1.685&r2=1.686&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.685 ZendEngine2/zend_compile.c:1.686
--- ZendEngine2/zend_compile.c:1.685 Wed Feb 22 09:03:26 2006
+++ ZendEngine2/zend_compile.c Wed Feb 22 10:56:52 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.685 2006/02/22 09:03:26 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.686 2006/02/22 10:56:52 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -2018,7 +2018,7 @@
}
-static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_function *proto)
+static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_function *proto
TSRMLS_DC)
{
zend_uint i;
@@ -2052,9 +2052,10 @@
/* Only one has a type hint and the other one doesn't */
return 0;
}
- if (fe->common.arg_info[i].class_name.v
- && strcmp(fe->common.arg_info[i].class_name.s,
proto->common.arg_info[i].class_name.s)!=0) {
- /* FIXME: Unicode support??? */
+ if (fe->common.arg_info[i].class_name.v &&
+ (fe->common.arg_info[i].class_name_len != proto->common.arg_info[i].class_name_len ||
+ (!UG(unicode) && zend_binary_strcasecmp(fe->common.arg_info[i].class_name.s,
fe->common.arg_info[i].class_name_len, proto->common.arg_info[i].class_name.s,
proto->common.arg_info[i].class_name_len) != 0) ||
+ (UG(unicode) && zend_u_binary_strcasecmp(fe->common.arg_info[i].class_name.u,
fe->common.arg_info[i].class_name_len, proto->common.arg_info[i].class_name.u,
proto->common.arg_info[i].class_name_len) != 0))) {
return 0;
}
if (fe->common.arg_info[i].array_type_hint != proto->common.arg_info[i].array_type_hint) {
@@ -2142,11 +2143,11 @@
if (child->common.prototype) {
- if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
+ if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Declaration of %v::%v() must be compatible with that of
%v::%v()", ZEND_FN_SCOPE_NAME(child), child->common.function_name,
ZEND_FN_SCOPE_NAME(child->common.prototype),
child->common.prototype->common.function_name);
}
} else if (EG(error_reporting) & E_STRICT) { /* Check E_STRICT before the check so that we
save some time */
- if (!zend_do_perform_implementation_check(child, parent)) {
+ if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
zend_error(E_STRICT, "Declaration of %v::%v() should be compatible with that of
%v::%v()", ZEND_FN_SCOPE_NAME(child), child->common.function_name,
ZEND_FN_SCOPE_NAME(parent), parent->common.function_name);
}
}