mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
- avoid local redeclaration
This commit is contained in:
parent
f47405315d
commit
3584bbee3b
1 changed files with 3 additions and 3 deletions
|
@ -6540,13 +6540,13 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
|
||||||
c_ns_name[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);
|
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)) {
|
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));
|
char *tmp2 = 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) ||
|
if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) ||
|
||||||
memcmp(tmp, c_ns_name, Z_STRLEN_P(ns))) {
|
memcmp(tmp2, 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));
|
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(tmp2);
|
||||||
}
|
}
|
||||||
efree(c_ns_name);
|
efree(c_ns_name);
|
||||||
} else if (zend_hash_find(CG(class_table), lcname, Z_STRLEN_P(name)+1, (void**)&pce) == SUCCESS &&
|
} else if (zend_hash_find(CG(class_table), lcname, Z_STRLEN_P(name)+1, (void**)&pce) == SUCCESS &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue