pajoye                                   Sat, 05 Sep 2009 21:16:05 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=288096

Log:
- don't hide previous declaration

Changed paths:
    U   php/php-src/branches/PHP_5_3/Zend/zend_compile.c
    U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_compile.c
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_compile.c    2009-09-05 20:59:27 UTC 
(rev 288095)
+++ php/php-src/branches/PHP_5_3/Zend/zend_compile.c    2009-09-05 21:16:05 UTC 
(rev 288096)
@@ -5191,31 +5191,31 @@

        if (CG(current_namespace)) {
                /* Prefix import name with current namespace name to avoid 
conflicts with classes */
-               char *ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 + 
Z_STRLEN_P(name) + 1);
+               char *c_ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 
+ Z_STRLEN_P(name) + 1);

-               zend_str_tolower_copy(ns_name, 
Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace)));
-               ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\';
-               memcpy(ns_name+Z_STRLEN_P(CG(current_namespace))+1, lcname, 
Z_STRLEN_P(name)+1);
-               if (zend_hash_exists(CG(class_table), ns_name, 
Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) {
+               zend_str_tolower_copy(c_ns_name, 
Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace)));
+               c_ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\';
+               memcpy(c_ns_name+Z_STRLEN_P(CG(current_namespace))+1, lcname, 
Z_STRLEN_P(name)+1);
+               if (zend_hash_exists(CG(class_table), c_ns_name, 
Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) {
                        char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), 
Z_STRLEN_P(ns));

                        if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) 
+ 1 + Z_STRLEN_P(name) ||
-                               memcmp(tmp, ns_name, Z_STRLEN_P(ns))) {
+                               memcmp(tmp, c_ns_name, Z_STRLEN_P(ns))) {
                                zend_error(E_COMPILE_ERROR, "Cannot use %s as 
%s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
                        }
                        efree(tmp);
                }
-               efree(ns_name);
+               efree(c_ns_name);
        } else if (zend_hash_find(CG(class_table), lcname, Z_STRLEN_P(name)+1, 
(void**)&pce) == SUCCESS &&
                   (*pce)->type == ZEND_USER_CLASS &&
                   (*pce)->filename == CG(compiled_filename)) {
-               char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), 
Z_STRLEN_P(ns));
+               char *c_tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), 
Z_STRLEN_P(ns));

                if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) ||
-                       memcmp(tmp, lcname, Z_STRLEN_P(ns))) {
+                       memcmp(c_tmp, lcname, Z_STRLEN_P(ns))) {
                        zend_error(E_COMPILE_ERROR, "Cannot use %s as %s 
because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
                }
-               efree(tmp);
+               efree(c_tmp);
        }

        if (zend_hash_add(CG(current_import), lcname, Z_STRLEN_P(name)+1, &ns, 
sizeof(zval*), NULL) != SUCCESS) {

Modified: php/php-src/trunk/Zend/zend_compile.c
===================================================================
--- php/php-src/trunk/Zend/zend_compile.c       2009-09-05 20:59:27 UTC (rev 
288095)
+++ php/php-src/trunk/Zend/zend_compile.c       2009-09-05 21:16:05 UTC (rev 
288096)
@@ -5480,28 +5480,28 @@
        if (CG(current_namespace)) {
                /* Prefix import name with current namespace name to avoid 
conflicts with classes */
                uint ns_name_len;
-               zstr ns_name = 
zend_u_str_case_fold(Z_TYPE_P(CG(current_namespace)), 
Z_UNIVAL_P(CG(current_namespace)), Z_UNILEN_P(CG(current_namespace)), 0, 
&ns_name_len);
+               zstr c_ns_name = 
zend_u_str_case_fold(Z_TYPE_P(CG(current_namespace)), 
Z_UNIVAL_P(CG(current_namespace)), Z_UNILEN_P(CG(current_namespace)), 0, 
&ns_name_len);

                if (Z_TYPE_P(CG(current_namespace)) == IS_UNICODE) {
-                       ns_name.u = eurealloc(ns_name.u, ns_name_len + 1 + 
lcname_len + 1);
-                       ns_name.u[ns_name_len] = '\\';
-                       memcpy(ns_name.u + ns_name_len + 1, lcname.u, 
UBYTES(lcname_len + 1));
+                       c_ns_name.u = eurealloc(c_ns_name.u, ns_name_len + 1 + 
lcname_len + 1);
+                       c_ns_name.u[ns_name_len] = '\\';
+                       memcpy(c_ns_name.u + ns_name_len + 1, lcname.u, 
UBYTES(lcname_len + 1));
                } else {
-                       ns_name.s = erealloc(ns_name.s, ns_name_len + 1 + 
lcname_len + 1);
-                       ns_name.s[ns_name_len] = '\\';
-                       memcpy(ns_name.s + ns_name_len + 1, lcname.s, 
lcname_len + 1);
+                       c_ns_name.s = erealloc(c_ns_name.s, ns_name_len + 1 + 
lcname_len + 1);
+                       c_ns_name.s[ns_name_len] = '\\';
+                       memcpy(c_ns_name.s + ns_name_len + 1, lcname.s, 
lcname_len + 1);
                }
-               if (zend_u_hash_exists(CG(class_table), 
Z_TYPE_P(CG(current_namespace)), ns_name, ns_name_len + 1 + lcname_len + 1)) {
+               if (zend_u_hash_exists(CG(class_table), 
Z_TYPE_P(CG(current_namespace)), c_ns_name, ns_name_len + 1 + lcname_len + 1)) {
                        unsigned int tmp_len;
                        zstr tmp = zend_u_str_case_fold(Z_TYPE_P(ns), 
Z_UNIVAL_P(ns), Z_UNILEN_P(ns), 0, &tmp_len);

                        if (tmp_len != ns_name_len + 1 + lcname_len ||
-                               memcmp(tmp.v, ns_name.v, UBYTES(tmp_len))) {
+                               memcmp(tmp.v, c_ns_name.v, UBYTES(tmp_len))) {
                                zend_error(E_COMPILE_ERROR, "Cannot use %R as 
%R because the name is already in use", Z_TYPE_P(ns), Z_UNIVAL_P(ns), 
Z_TYPE_P(name), Z_UNIVAL_P(name));
                        }
                        efree(tmp.v);
                }
-               efree(ns_name.v);
+               efree(c_ns_name.v);
        } else if (zend_u_hash_find(CG(class_table), Z_TYPE_P(name), lcname, 
lcname_len+1, (void**)&pce) == SUCCESS &&
                   (*pce)->type == ZEND_USER_CLASS &&
                   (*pce)->filename == CG(compiled_filename)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to