cvs: ZendEngine2 / zend.c zend_API.c zend_API.h zend_builtin_functions.c zend_compile.c zend_constants.c zend_hash.c zend_object_handlers.c
zend_objects.c zend_operators.c
| From: | Dmitry Stogov | Date: | Mon, 15 Aug 2005 14:39:19 +0000 |
| Subject: | cvs: ZendEngine2 / zend.c zend_API.c zend_API.h zend_builtin_functions.c zend_compile.c zend_constants.c zend_hash.c zend_object_handlers.c zend_objects.c zend_operators.c |
||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4013@lists.php.net to get a copy of this message | ||
dmitry Mon Aug 15 10:39:19 2005 EDT
Modified files:
/ZendEngine2 zend.c zend_API.c zend_API.h zend_builtin_functions.c
zend_compile.c zend_constants.c zend_hash.c
zend_object_handlers.c zend_objects.c zend_operators.c
Log:
Fixed several unicode related bugs
http://cvs.php.net/diff.php/ZendEngine2/zend.c?r1=1.315&r2=1.316&ty=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.315 ZendEngine2/zend.c:1.316 --- ZendEngine2/zend.c:1.315 Mon Aug 15 03:12:52 2005 +++ ZendEngine2/zend.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.c,v 1.315 2005/08/15 07:12:52 dmitry Exp $ */ +/* $Id: zend.c,v 1.316 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -320,6 +320,12 @@ case HASH_KEY_IS_STRING: ZEND_PUTS(string_key); break; + case HASH_KEY_IS_BINARY: + zend_printf("b\"%s\"", string_key); + break; + case HASH_KEY_IS_UNICODE: + zend_printf("%r", string_key); + break; case HASH_KEY_IS_LONG: zend_printf("%ld", num_key); break; http://cvs.php.net/diff.php/ZendEngine2/zend_API.c?r1=1.300&r2=1.301&ty=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.300 ZendEngine2/zend_API.c:1.301 --- ZendEngine2/zend_API.c:1.300 Fri Aug 12 10:57:10 2005 +++ ZendEngine2/zend_API.c Mon Aug 15 10:39:18 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.300 2005/08/12 14:57:10 dmitry Exp $ */ +/* $Id: zend_API.c,v 1.301 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -165,7 +165,7 @@ ALLOC_ZVAL(value_ptr); *value_ptr = **value; INIT_PZVAL(value_ptr); - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); + zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", class_name); if(!dup) { efree(class_name); } http://cvs.php.net/diff.php/ZendEngine2/zend_API.h?r1=1.210&r2=1.211&ty=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.210 ZendEngine2/zend_API.h:1.211 --- ZendEngine2/zend_API.h:1.210 Fri Aug 12 07:29:24 2005 +++ ZendEngine2/zend_API.h Mon Aug 15 10:39:18 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.210 2005/08/12 11:29:24 dmitry Exp $ */ +/* $Id: zend_API.h,v 1.211 2005/08/15 14:39:18 dmitry Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -218,6 +218,7 @@ ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC); ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, void *name, int name_length, zval *property, int access_type TSRMLS_DC); +ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, void *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC); ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC); ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC); http://cvs.php.net/diff.php/ZendEngine2/zend_builtin_functions.c?r1=1.278&r2=1.279&ty=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.278 ZendEngine2/zend_builtin_functions.c:1.279 --- ZendEngine2/zend_builtin_functions.c:1.278 Thu Aug 11 19:34:54 2005 +++ ZendEngine2/zend_builtin_functions.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.278 2005/08/11 23:34:54 andrei Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.279 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" @@ -920,8 +920,8 @@ } if (Z_TYPE_PP(klass) == IS_OBJECT) { ce = Z_OBJCE_PP(klass); - } else if (Z_TYPE_PP(klass) == IS_STRING) { - if (zend_lookup_class(Z_STRVAL_PP(klass), Z_STRLEN_PP(klass), &pce TSRMLS_CC) == FAILURE) { + } else if (Z_TYPE_PP(klass) == IS_STRING || Z_TYPE_PP(klass) == IS_UNICODE) { + if (zend_u_lookup_class(Z_TYPE_PP(klass), Z_STRVAL_PP(klass), Z_STRLEN_PP(klass), &pce TSRMLS_CC) == FAILURE) { RETURN_FALSE; } ce = *pce; @@ -929,7 +929,9 @@ RETURN_FALSE; } - convert_to_string_ex(method_name); + if (Z_TYPE_PP(method_name) != IS_STRING || Z_TYPE_PP(method_name) == IS_UNICODE) { + convert_to_text_ex(method_name); + } lcname = zend_u_str_case_fold(Z_TYPE_PP(method_name), Z_UNIVAL_PP(method_name), Z_UNILEN_PP(method_name), 1, &lcname_len); if (zend_u_hash_exists(&ce->function_table, Z_TYPE_PP(method_name), lcname, lcname_len+1)) { efree(lcname); @@ -968,17 +970,22 @@ if (ZEND_NUM_ARGS()!= 2 || zend_get_parameters_ex(2, &object, &property)==FAILURE) { ZEND_WRONG_PARAM_COUNT(); } - convert_to_string_ex(property); - if (!Z_STRLEN_PP(property)) { + + if (Z_TYPE_PP(property) != IS_STRING && Z_TYPE_PP(property) != IS_UNICODE) { + convert_to_text_ex(property); + } + + if (!Z_UNILEN_PP(property)) { RETURN_FALSE; } switch((*object)->type) { case IS_STRING: - if (!Z_STRLEN_PP(object)) { + case IS_UNICODE: + if (!Z_UNILEN_PP(object)) { RETURN_FALSE; } - if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_PP(object), &pce TSRMLS_CC) == SUCCESS) { + if (zend_u_lookup_class(Z_TYPE_PP(object), Z_UNIVAL_PP(object), Z_UNILEN_PP(object), &pce TSRMLS_CC) == SUCCESS) { ce = *pce; } else { RETURN_FALSE; @@ -992,14 +999,14 @@ if (property_info->flags & ZEND_ACC_PUBLIC) { RETURN_TRUE; } - zend_unmangle_property_name(property_info->name, &class_name, &prop_name); - if (!strncmp(class_name, "*", 1)) { + zend_u_unmangle_property_name(Z_TYPE_PP(property), property_info->name, &class_name, &prop_name); + if (class_name[0] == '*') { if (instanceof_function(EG(scope), ce TSRMLS_CC)) { RETURN_TRUE; } RETURN_FALSE; } - if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_PP(object), &pce TSRMLS_CC) == SUCCESS) { + if (zend_u_lookup_class(Z_TYPE_PP(object), Z_UNIVAL_PP(object), Z_UNILEN_PP(object), &pce TSRMLS_CC) == SUCCESS) { ce = *pce; } else { RETURN_FALSE; /* shouldn't happen */ @@ -1880,7 +1887,7 @@ zend_printf("#%-2d ", indent); if (class_name) { if (UG(unicode)) { - zend_printf("%r(", class_name); + zend_printf("%r", class_name); } else { ZEND_PUTS(class_name); } http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.652&r2=1.653&ty=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.652 ZendEngine2/zend_compile.c:1.653 --- ZendEngine2/zend_compile.c:1.652 Fri Aug 12 07:29:25 2005 +++ ZendEngine2/zend_compile.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.652 2005/08/12 11:29:25 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.653 2005/08/15 14:39:18 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -2962,7 +2962,7 @@ CG(doc_comment_len) = 0; } - zend_u_declare_property(CG(active_class_entry), Z_TYPE(var_name->u.constant), Z_UNIVAL(var_name->u.constant), Z_UNILEN(var_name->u.constant), property, access_type TSRMLS_CC); + zend_u_declare_property_ex(CG(active_class_entry), Z_TYPE(var_name->u.constant), Z_UNIVAL(var_name->u.constant), Z_UNILEN(var_name->u.constant), property, access_type, comment, comment_len TSRMLS_CC); efree(var_name->u.constant.value.str.val); } http://cvs.php.net/diff.php/ZendEngine2/zend_constants.c?r1=1.72&r2=1.73&ty=u Index: ZendEngine2/zend_constants.c diff -u ZendEngine2/zend_constants.c:1.72 ZendEngine2/zend_constants.c:1.73 --- ZendEngine2/zend_constants.c:1.72 Thu Aug 11 19:34:55 2005 +++ ZendEngine2/zend_constants.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_constants.c,v 1.72 2005/08/11 23:34:55 andrei Exp $ */ +/* $Id: zend_constants.c,v 1.73 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_constants.h" @@ -332,7 +332,7 @@ } if (zend_u_hash_add(EG(zend_constants), type, name, lookup_name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { - zend_error(E_NOTICE,"Constant %s already defined", name); + zend_error(E_NOTICE,"Constant %R already defined", type, name); free(c->name); if (!(c->flags & CONST_PERSISTENT)) { zval_dtor(&c->value); http://cvs.php.net/diff.php/ZendEngine2/zend_hash.c?r1=1.123&r2=1.124&ty=u Index: ZendEngine2/zend_hash.c diff -u ZendEngine2/zend_hash.c:1.123 ZendEngine2/zend_hash.c:1.124 --- ZendEngine2/zend_hash.c:1.123 Fri Aug 12 18:53:13 2005 +++ ZendEngine2/zend_hash.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_hash.c,v 1.123 2005/08/12 22:53:13 tony2001 Exp $ */ +/* $Id: zend_hash.c,v 1.124 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_operators.h" @@ -1297,6 +1297,7 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, char *str_index, uint str_length, ulong num_index, HashPosition *pos) { Bucket *p; + uint real_length; p = pos ? (*pos) : ht->pInternalPointer; @@ -1304,12 +1305,13 @@ if (p) { if (key_type == HASH_KEY_IS_LONG) { - str_length = 0; + real_length = str_length = 0; if (!p->nKeyLength && p->h == num_index) { return SUCCESS; } zend_hash_index_del(ht, num_index); } else if (key_type == HASH_KEY_IS_STRING || key_type == HASH_KEY_IS_BINARY) { + real_length = str_length; if (p->nKeyLength == str_length && p->key.type == ((key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY) && memcmp(p->key.u.string, str_index, str_length) == 0) { @@ -1317,9 +1319,10 @@ } zend_u_hash_del(ht, (key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY, str_index, str_length); } else if (key_type == HASH_KEY_IS_UNICODE) { + real_length = str_length * sizeof(UChar); if (p->nKeyLength == str_length && p->key.type == IS_UNICODE && - memcmp(p->key.u.string, str_index, str_length * sizeof(UChar*)) == 0) { + memcmp(p->key.u.string, str_index, real_length) == 0) { return SUCCESS; } zend_u_hash_del(ht, IS_UNICODE, str_index, str_length); @@ -1339,7 +1342,7 @@ } if (p->nKeyLength != str_length) { - Bucket *q = (Bucket *) pemalloc(sizeof(Bucket) - 1 + str_length, ht->persistent); + Bucket *q = (Bucket *) pemalloc(sizeof(Bucket) - 1 + real_length, ht->persistent); q->nKeyLength = str_length; if (p->pData == &p->pDataPtr) { @@ -1373,11 +1376,11 @@ if (key_type == HASH_KEY_IS_LONG) { p->h = num_index; } else if (key_type == HASH_KEY_IS_UNICODE) { - memcpy(p->key.u.unicode, str_index, str_length * sizeof(UChar)); + memcpy(p->key.u.unicode, str_index, real_length); p->key.type = IS_UNICODE; p->h = zend_u_inline_hash_func(IS_UNICODE, str_index, str_length); } else { - memcpy(p->key.u.string, str_index, str_length); + memcpy(p->key.u.string, str_index, real_length); p->key.type = (key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY; p->h = zend_u_inline_hash_func(p->key.type, str_index, str_length); } http://cvs.php.net/diff.php/ZendEngine2/zend_object_handlers.c?r1=1.138&r2=1.139&ty=u Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.138 ZendEngine2/zend_object_handlers.c:1.139 --- ZendEngine2/zend_object_handlers.c:1.138 Fri Aug 12 08:58:41 2005 +++ ZendEngine2/zend_object_handlers.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.c,v 1.138 2005/08/12 12:58:41 dmitry Exp $ */ +/* $Id: zend_object_handlers.c,v 1.139 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -266,7 +266,10 @@ if (!(property_info->flags & ZEND_ACC_PRIVATE)) { /* we we're looking for a private prop but found a non private one of the same name */ return FAILURE; - } else if (strcmp(prop_info_name+1, property_info->name+1)) { + } else if (!UG(unicode) && strcmp(prop_info_name+1, property_info->name+1)) { + /* we we're looking for a private prop but found a private one of the same name but another class */ + return FAILURE; + } else if (UG(unicode) && u_strcmp(((UChar*)prop_info_name)+1, ((UChar*)property_info->name)+1)) { /* we we're looking for a private prop but found a private one of the same name but another class */ return FAILURE; } http://cvs.php.net/diff.php/ZendEngine2/zend_objects.c?r1=1.57&r2=1.58&ty=u Index: ZendEngine2/zend_objects.c diff -u ZendEngine2/zend_objects.c:1.57 ZendEngine2/zend_objects.c:1.58 --- ZendEngine2/zend_objects.c:1.57 Thu Aug 11 19:34:58 2005 +++ ZendEngine2/zend_objects.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_objects.c,v 1.57 2005/08/11 23:34:58 andrei Exp $ */ +/* $Id: zend_objects.c,v 1.58 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -119,7 +119,7 @@ TSRMLS_FETCH(); if (Z_OBJ_HANDLER_PP(p, clone_obj) == NULL) { - zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_PP(p)->name); + zend_error(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_PP(p)->name); } else { zval *orig = *p; http://cvs.php.net/diff.php/ZendEngine2/zend_operators.c?r1=1.210&r2=1.211&ty=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.210 ZendEngine2/zend_operators.c:1.211 --- ZendEngine2/zend_operators.c:1.210 Fri Aug 12 07:29:26 2005 +++ ZendEngine2/zend_operators.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.c,v 1.210 2005/08/12 11:29:26 dmitry Exp $ */ +/* $Id: zend_operators.c,v 1.211 2005/08/15 14:39:18 dmitry Exp $ */ #include <ctype.h> @@ -398,7 +398,7 @@ retval = (zend_hash_num_elements(ht)?1:0); } } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name); + zend_error(E_NOTICE, "Object of class %v could not be converted to int", Z_OBJCE_P(op)->name); } zval_dtor(op); ZVAL_LONG(op, retval);
http://cvs.php.net/diff.php/ZendEngine2/zend.c?r1=1.315&r2=1.316&ty=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.315 ZendEngine2/zend.c:1.316 --- ZendEngine2/zend.c:1.315 Mon Aug 15 03:12:52 2005 +++ ZendEngine2/zend.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.c,v 1.315 2005/08/15 07:12:52 dmitry Exp $ */ +/* $Id: zend.c,v 1.316 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -320,6 +320,12 @@ case HASH_KEY_IS_STRING: ZEND_PUTS(string_key); break; + case HASH_KEY_IS_BINARY: + zend_printf("b\"%s\"", string_key); + break; + case HASH_KEY_IS_UNICODE: + zend_printf("%r", string_key); + break; case HASH_KEY_IS_LONG: zend_printf("%ld", num_key); break; http://cvs.php.net/diff.php/ZendEngine2/zend_API.c?r1=1.300&r2=1.301&ty=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.300 ZendEngine2/zend_API.c:1.301 --- ZendEngine2/zend_API.c:1.300 Fri Aug 12 10:57:10 2005 +++ ZendEngine2/zend_API.c Mon Aug 15 10:39:18 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.300 2005/08/12 14:57:10 dmitry Exp $ */ +/* $Id: zend_API.c,v 1.301 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -165,7 +165,7 @@ ALLOC_ZVAL(value_ptr); *value_ptr = **value; INIT_PZVAL(value_ptr); - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); + zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", class_name); if(!dup) { efree(class_name); } http://cvs.php.net/diff.php/ZendEngine2/zend_API.h?r1=1.210&r2=1.211&ty=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.210 ZendEngine2/zend_API.h:1.211 --- ZendEngine2/zend_API.h:1.210 Fri Aug 12 07:29:24 2005 +++ ZendEngine2/zend_API.h Mon Aug 15 10:39:18 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.210 2005/08/12 11:29:24 dmitry Exp $ */ +/* $Id: zend_API.h,v 1.211 2005/08/15 14:39:18 dmitry Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -218,6 +218,7 @@ ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC); ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, void *name, int name_length, zval *property, int access_type TSRMLS_DC); +ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, void *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC); ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC); ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC); http://cvs.php.net/diff.php/ZendEngine2/zend_builtin_functions.c?r1=1.278&r2=1.279&ty=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.278 ZendEngine2/zend_builtin_functions.c:1.279 --- ZendEngine2/zend_builtin_functions.c:1.278 Thu Aug 11 19:34:54 2005 +++ ZendEngine2/zend_builtin_functions.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.278 2005/08/11 23:34:54 andrei Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.279 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" @@ -920,8 +920,8 @@ } if (Z_TYPE_PP(klass) == IS_OBJECT) { ce = Z_OBJCE_PP(klass); - } else if (Z_TYPE_PP(klass) == IS_STRING) { - if (zend_lookup_class(Z_STRVAL_PP(klass), Z_STRLEN_PP(klass), &pce TSRMLS_CC) == FAILURE) { + } else if (Z_TYPE_PP(klass) == IS_STRING || Z_TYPE_PP(klass) == IS_UNICODE) { + if (zend_u_lookup_class(Z_TYPE_PP(klass), Z_STRVAL_PP(klass), Z_STRLEN_PP(klass), &pce TSRMLS_CC) == FAILURE) { RETURN_FALSE; } ce = *pce; @@ -929,7 +929,9 @@ RETURN_FALSE; } - convert_to_string_ex(method_name); + if (Z_TYPE_PP(method_name) != IS_STRING || Z_TYPE_PP(method_name) == IS_UNICODE) { + convert_to_text_ex(method_name); + } lcname = zend_u_str_case_fold(Z_TYPE_PP(method_name), Z_UNIVAL_PP(method_name), Z_UNILEN_PP(method_name), 1, &lcname_len); if (zend_u_hash_exists(&ce->function_table, Z_TYPE_PP(method_name), lcname, lcname_len+1)) { efree(lcname); @@ -968,17 +970,22 @@ if (ZEND_NUM_ARGS()!= 2 || zend_get_parameters_ex(2, &object, &property)==FAILURE) { ZEND_WRONG_PARAM_COUNT(); } - convert_to_string_ex(property); - if (!Z_STRLEN_PP(property)) { + + if (Z_TYPE_PP(property) != IS_STRING && Z_TYPE_PP(property) != IS_UNICODE) { + convert_to_text_ex(property); + } + + if (!Z_UNILEN_PP(property)) { RETURN_FALSE; } switch((*object)->type) { case IS_STRING: - if (!Z_STRLEN_PP(object)) { + case IS_UNICODE: + if (!Z_UNILEN_PP(object)) { RETURN_FALSE; } - if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_PP(object), &pce TSRMLS_CC) == SUCCESS) { + if (zend_u_lookup_class(Z_TYPE_PP(object), Z_UNIVAL_PP(object), Z_UNILEN_PP(object), &pce TSRMLS_CC) == SUCCESS) { ce = *pce; } else { RETURN_FALSE; @@ -992,14 +999,14 @@ if (property_info->flags & ZEND_ACC_PUBLIC) { RETURN_TRUE; } - zend_unmangle_property_name(property_info->name, &class_name, &prop_name); - if (!strncmp(class_name, "*", 1)) { + zend_u_unmangle_property_name(Z_TYPE_PP(property), property_info->name, &class_name, &prop_name); + if (class_name[0] == '*') { if (instanceof_function(EG(scope), ce TSRMLS_CC)) { RETURN_TRUE; } RETURN_FALSE; } - if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_PP(object), &pce TSRMLS_CC) == SUCCESS) { + if (zend_u_lookup_class(Z_TYPE_PP(object), Z_UNIVAL_PP(object), Z_UNILEN_PP(object), &pce TSRMLS_CC) == SUCCESS) { ce = *pce; } else { RETURN_FALSE; /* shouldn't happen */ @@ -1880,7 +1887,7 @@ zend_printf("#%-2d ", indent); if (class_name) { if (UG(unicode)) { - zend_printf("%r(", class_name); + zend_printf("%r", class_name); } else { ZEND_PUTS(class_name); } http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.652&r2=1.653&ty=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.652 ZendEngine2/zend_compile.c:1.653 --- ZendEngine2/zend_compile.c:1.652 Fri Aug 12 07:29:25 2005 +++ ZendEngine2/zend_compile.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.652 2005/08/12 11:29:25 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.653 2005/08/15 14:39:18 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -2962,7 +2962,7 @@ CG(doc_comment_len) = 0; } - zend_u_declare_property(CG(active_class_entry), Z_TYPE(var_name->u.constant), Z_UNIVAL(var_name->u.constant), Z_UNILEN(var_name->u.constant), property, access_type TSRMLS_CC); + zend_u_declare_property_ex(CG(active_class_entry), Z_TYPE(var_name->u.constant), Z_UNIVAL(var_name->u.constant), Z_UNILEN(var_name->u.constant), property, access_type, comment, comment_len TSRMLS_CC); efree(var_name->u.constant.value.str.val); } http://cvs.php.net/diff.php/ZendEngine2/zend_constants.c?r1=1.72&r2=1.73&ty=u Index: ZendEngine2/zend_constants.c diff -u ZendEngine2/zend_constants.c:1.72 ZendEngine2/zend_constants.c:1.73 --- ZendEngine2/zend_constants.c:1.72 Thu Aug 11 19:34:55 2005 +++ ZendEngine2/zend_constants.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_constants.c,v 1.72 2005/08/11 23:34:55 andrei Exp $ */ +/* $Id: zend_constants.c,v 1.73 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_constants.h" @@ -332,7 +332,7 @@ } if (zend_u_hash_add(EG(zend_constants), type, name, lookup_name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { - zend_error(E_NOTICE,"Constant %s already defined", name); + zend_error(E_NOTICE,"Constant %R already defined", type, name); free(c->name); if (!(c->flags & CONST_PERSISTENT)) { zval_dtor(&c->value); http://cvs.php.net/diff.php/ZendEngine2/zend_hash.c?r1=1.123&r2=1.124&ty=u Index: ZendEngine2/zend_hash.c diff -u ZendEngine2/zend_hash.c:1.123 ZendEngine2/zend_hash.c:1.124 --- ZendEngine2/zend_hash.c:1.123 Fri Aug 12 18:53:13 2005 +++ ZendEngine2/zend_hash.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_hash.c,v 1.123 2005/08/12 22:53:13 tony2001 Exp $ */ +/* $Id: zend_hash.c,v 1.124 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_operators.h" @@ -1297,6 +1297,7 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, char *str_index, uint str_length, ulong num_index, HashPosition *pos) { Bucket *p; + uint real_length; p = pos ? (*pos) : ht->pInternalPointer; @@ -1304,12 +1305,13 @@ if (p) { if (key_type == HASH_KEY_IS_LONG) { - str_length = 0; + real_length = str_length = 0; if (!p->nKeyLength && p->h == num_index) { return SUCCESS; } zend_hash_index_del(ht, num_index); } else if (key_type == HASH_KEY_IS_STRING || key_type == HASH_KEY_IS_BINARY) { + real_length = str_length; if (p->nKeyLength == str_length && p->key.type == ((key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY) && memcmp(p->key.u.string, str_index, str_length) == 0) { @@ -1317,9 +1319,10 @@ } zend_u_hash_del(ht, (key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY, str_index, str_length); } else if (key_type == HASH_KEY_IS_UNICODE) { + real_length = str_length * sizeof(UChar); if (p->nKeyLength == str_length && p->key.type == IS_UNICODE && - memcmp(p->key.u.string, str_index, str_length * sizeof(UChar*)) == 0) { + memcmp(p->key.u.string, str_index, real_length) == 0) { return SUCCESS; } zend_u_hash_del(ht, IS_UNICODE, str_index, str_length); @@ -1339,7 +1342,7 @@ } if (p->nKeyLength != str_length) { - Bucket *q = (Bucket *) pemalloc(sizeof(Bucket) - 1 + str_length, ht->persistent); + Bucket *q = (Bucket *) pemalloc(sizeof(Bucket) - 1 + real_length, ht->persistent); q->nKeyLength = str_length; if (p->pData == &p->pDataPtr) { @@ -1373,11 +1376,11 @@ if (key_type == HASH_KEY_IS_LONG) { p->h = num_index; } else if (key_type == HASH_KEY_IS_UNICODE) { - memcpy(p->key.u.unicode, str_index, str_length * sizeof(UChar)); + memcpy(p->key.u.unicode, str_index, real_length); p->key.type = IS_UNICODE; p->h = zend_u_inline_hash_func(IS_UNICODE, str_index, str_length); } else { - memcpy(p->key.u.string, str_index, str_length); + memcpy(p->key.u.string, str_index, real_length); p->key.type = (key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY; p->h = zend_u_inline_hash_func(p->key.type, str_index, str_length); } http://cvs.php.net/diff.php/ZendEngine2/zend_object_handlers.c?r1=1.138&r2=1.139&ty=u Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.138 ZendEngine2/zend_object_handlers.c:1.139 --- ZendEngine2/zend_object_handlers.c:1.138 Fri Aug 12 08:58:41 2005 +++ ZendEngine2/zend_object_handlers.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.c,v 1.138 2005/08/12 12:58:41 dmitry Exp $ */ +/* $Id: zend_object_handlers.c,v 1.139 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -266,7 +266,10 @@ if (!(property_info->flags & ZEND_ACC_PRIVATE)) { /* we we're looking for a private prop but found a non private one of the same name */ return FAILURE; - } else if (strcmp(prop_info_name+1, property_info->name+1)) { + } else if (!UG(unicode) && strcmp(prop_info_name+1, property_info->name+1)) { + /* we we're looking for a private prop but found a private one of the same name but another class */ + return FAILURE; + } else if (UG(unicode) && u_strcmp(((UChar*)prop_info_name)+1, ((UChar*)property_info->name)+1)) { /* we we're looking for a private prop but found a private one of the same name but another class */ return FAILURE; } http://cvs.php.net/diff.php/ZendEngine2/zend_objects.c?r1=1.57&r2=1.58&ty=u Index: ZendEngine2/zend_objects.c diff -u ZendEngine2/zend_objects.c:1.57 ZendEngine2/zend_objects.c:1.58 --- ZendEngine2/zend_objects.c:1.57 Thu Aug 11 19:34:58 2005 +++ ZendEngine2/zend_objects.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_objects.c,v 1.57 2005/08/11 23:34:58 andrei Exp $ */ +/* $Id: zend_objects.c,v 1.58 2005/08/15 14:39:18 dmitry Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -119,7 +119,7 @@ TSRMLS_FETCH(); if (Z_OBJ_HANDLER_PP(p, clone_obj) == NULL) { - zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_PP(p)->name); + zend_error(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_PP(p)->name); } else { zval *orig = *p; http://cvs.php.net/diff.php/ZendEngine2/zend_operators.c?r1=1.210&r2=1.211&ty=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.210 ZendEngine2/zend_operators.c:1.211 --- ZendEngine2/zend_operators.c:1.210 Fri Aug 12 07:29:26 2005 +++ ZendEngine2/zend_operators.c Mon Aug 15 10:39:18 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.c,v 1.210 2005/08/12 11:29:26 dmitry Exp $ */ +/* $Id: zend_operators.c,v 1.211 2005/08/15 14:39:18 dmitry Exp $ */ #include <ctype.h> @@ -398,7 +398,7 @@ retval = (zend_hash_num_elements(ht)?1:0); } } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name); + zend_error(E_NOTICE, "Object of class %v could not be converted to int", Z_OBJCE_P(op)->name); } zval_dtor(op); ZVAL_LONG(op, retval);