com php-src: Merge branch 'master' into str_size_and_int 64: Zend/zend_compile.c Zend/zend_language_pa rser.y ext/date/php_date.c
ext/intl/collator/collator _create.c ext/intl/dateformat/dateformat_parse.c ex t/intl/formatter/formatter_main.c ext/intl/locale/locale _methods.c
ext/intl/msgformat/msgformat.c ext/intl/ms gformat/msgformat_format.c ext/intl/msgformat/msgformat _helpers.cpp ext/intl/msgformat/msgformat_parse.c e
xt/standard/assert.c ext/stand

From: Date: Fri, 25 Oct 2013 11:19:27 +0000
Subject: com php-src: Merge branch 'master' into str_size_and_int 64: Zend/zend_compile.c Zend/zend_language_pa rser.y ext/date/php_date.c
ext/intl/collator/collator _create.c ext/intl/dateformat/dateformat_parse.c ex t/intl/formatter/formatter_main.c ext/intl/locale/locale _methods.c
ext/intl/msgformat/msgformat.c ext/intl/ms gformat/msgformat_format.c ext/intl/msgformat/msgformat _helpers.cpp ext/intl/msgformat/msgformat_parse.c e
xt/standard/assert.c ext/stand
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-73804@lists.php.net to get a copy of this message
Commit: 4fc7dc6eae7402f195fd8c04367fc621cc2503c4 Author: Anatol Belski <ab@php.net> Fri, 25 Oct 2013 04:19:27 -0700 Parents: f0fdb82f83fa62d6fa8b13dbaae5acc8a099d4e2 dfe4b15b8e8932ce3c49b670ca2e59e70ebc0055 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4fc7dc6eae7402f195fd8c04367fc621cc2503c4 Log: Merge branch 'master' into str_size_and_int64 * master: (79 commits) ldap_escape() notes Increment version number, since this will be 5.5.6. Added Zend Debugger to the note about the load order (by trash4you at online dot de) Added a LICENSE file to make it easier for PECL binary distributions to conform with the license. Fix Coverity issue reporting wrong sizeof() Fixed bug #65939 (Space before ";" breaks php.ini parsing). (brainstorm at nopcode dot org) exif NEWS add tests for bug #62523 Merged PR #293 (Exif crash on unknown encoding was fixed) By: Draal Conflicts: configure.in main/php_version.h fix bug #65936 (dangling context pointer causes crash) remove TRAVIS check in test source Fixed compilation warning Just SKIP that test on travis Fixed issue #115 (path issue when using phar). fix memory leak on error (from Coverity scan) fix argument type & remove warning fix const warnings in intl methods Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag fix possibility of access to *storedType without initialization Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag ... Conflicts: Zend/zend_compile.c ext/intl/collator/collator_create.c ext/intl/locale/locale_methods.c ext/intl/msgformat/msgformat_format.c ext/intl/msgformat/msgformat_parse.c Bugs: https://bugs.php..net/65939 https://bugs.php.net/62523 https://bugs.php.net/293 https://bugs.php.net/65936 https://bugs.php.net/115 Changed paths: MM Zend/zend_compile.c MM Zend/zend_language_parser.y MM ext/date/php_date.c MM ext/intl/collator/collator_create.c MM ext/intl/dateformat/dateformat_parse.c MM ext/intl/formatter/formatter_main.c MM ext/intl/locale/locale_methods.c MM ext/intl/msgformat/msgformat.c MM ext/intl/msgformat/msgformat_format.c MM ext/intl/msgformat/msgformat_helpers.cpp MM ext/intl/msgformat/msgformat_parse.c MM ext/standard/assert.c MM ext/standard/basic_functions.c MM ext/standard/file.c MM ext/standard/password.c MM ext/standard/var.c MM main/streams/php_stream_transport.h

diff --cc Zend/zend_compile.c index 6621755,7ee8dd1..e9373b9 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@@ -901,8 -901,9 +901,9 @@@ static zend_bool opline_is_fetch_this(c { if ((opline->opcode == ZEND_FETCH_W) && (opline->op1_type == IS_CONST) && (Z_TYPE(CONSTANT(opline->op1.constant)) == IS_STRING) + && ((opline->extended_value & ZEND_FETCH_STATIC_MEMBER) != ZEND_FETCH_STATIC_MEMBER) && (Z_HASH_P(&CONSTANT(opline->op1.constant)) == THIS_HASHVAL) - && (Z_STRLEN(CONSTANT(opline->op1.constant)) == (sizeof("this")-1)) + && (Z_STRSIZE(CONSTANT(opline->op1.constant)) == (sizeof("this")-1)) && !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this"))) { return 1; } else { @@@ -1827,11 -1828,11 +1828,11 @@@ void zend_do_receive_param(zend_uchar o zend_arg_info *cur_arg_info; znode var; - if (zend_is_auto_global(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant) TSRMLS_CC)) { + if (zend_is_auto_global(Z_STRVAL(varname->u.constant), Z_STRSIZE(varname->u.constant) TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant)); } else { var.op_type = IS_CV; - var.u.op.var = lookup_cv(CG(active_op_array), Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), 0 TSRMLS_CC); + var.u.op.var = lookup_cv(CG(active_op_array), Z_STRVAL(varname->u.constant), Z_STRSIZE(varname->u.constant), 0 TSRMLS_CC); Z_STRVAL(varname->u.constant) = (char*)CG(active_op_array)->vars[var.u.op.var].name; var.EA = 0; if (CG(active_op_array)->vars[var.u.op.var].hash_value == THIS_HASHVAL && @@@ -1976,9 -1977,9 +1977,9 @@@ void zend_do_begin_method_call(znode *l last_op_number = get_next_op_number(CG(active_op_array))-1; last_op = &CG(active_op_array)->opcodes[last_op_number]; - if ((last_op->op2_type == IS_CONST) && (Z_TYPE(CONSTANT(last_op->op2.constant)) == IS_STRING) && (Z_STRLEN(CONSTANT(last_op->op2.constant)) == sizeof(ZEND_CLONE_FUNC_NAME)-1) - && !zend_binary_strcasecmp(Z_STRVAL(CONSTANT(last_op->op2.constant)), Z_STRLEN(CONSTANT(last_op->op2.constant)), ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)-1)) { + if ((last_op->op2_type == IS_CONST) && (Z_TYPE(CONSTANT(last_op->op2.constant)) == IS_STRING) && (Z_STRSIZE(CONSTANT(last_op->op2.constant)) == sizeof(ZEND_CLONE_FUNC_NAME)-1) + && !zend_binary_strcasecmp(Z_STRVAL(CONSTANT(last_op->op2.constant)), Z_STRSIZE(CONSTANT(last_op->op2.constant)), ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)-1)) { - zend_error(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead"); } if (last_op->opcode == ZEND_FETCH_OBJ_R) { @@@ -1986,9 -1987,9 +1987,9 @@@ zval name; name = CONSTANT(last_op->op2.constant); if (Z_TYPE(name) != IS_STRING) { - zend_error(E_COMPILE_ERROR, "Method name must be a string"); + zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string"); } - Z_STRVAL(name) = str_estrndup(Z_STRVAL(name), Z_STRLEN(name)); + Z_STRVAL(name) = str_estrndup(Z_STRVAL(name), Z_STRSIZE(name)); FREE_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant); last_op->op2.constant = zend_add_func_name_literal(CG(active_op_array), &name TSRMLS_CC); @@@ -2180,14 -2181,14 +2181,14 @@@ void zend_resolve_class_name(znode *cla /* This is a compound class name that contains namespace prefix */ if (Z_STRVAL(class_name->u.constant)[0] == '\\') { /* The STRING name has "\" prefix */ - Z_STRLEN(class_name->u.constant) -= 1; - memmove(Z_STRVAL(class_name->u.constant), Z_STRVAL(class_name->u.constant)+1, Z_STRLEN(class_name->u.constant)+1); + Z_STRSIZE(class_name->u.constant) -= 1; + memmove(Z_STRVAL(class_name->u.constant), Z_STRVAL(class_name->u.constant)+1, Z_STRSIZE(class_name->u.constant)+1); Z_STRVAL(class_name->u.constant) = erealloc( Z_STRVAL(class_name->u.constant), - Z_STRLEN(class_name->u.constant) + 1); + Z_STRSIZE(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))) { + if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRSIZE(class_name->u.constant))) { - zend_error(E_COMPILE_ERROR, "'\\%s' is an invalid class name", Z_STRVAL(class_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "'\\%s' is an invalid class name", Z_STRVAL(class_name->u.constant)); } } else { if (CG(current_import)) { @@@ -2294,8 -2295,8 +2295,8 @@@ void zend_do_label(znode *label TSRMLS_ dest.brk_cont = CG(context).current_brk_cont; dest.opline_num = get_next_op_number(CG(active_op_array)); - if (zend_hash_add(CG(context).labels, Z_STRVAL(label->u.constant), Z_STRLEN(label->u.constant) + 1, (void**)&dest, sizeof(zend_label), NULL) == FAILURE) { + if (zend_hash_add(CG(context).labels, Z_STRVAL(label->u.constant), Z_STRSIZE(label->u.constant) + 1, (void**)&dest, sizeof(zend_label), NULL) == FAILURE) { - zend_error(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL(label->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL(label->u.constant)); } /* Done with label now */ @@@ -2429,10 -2430,10 +2430,10 @@@ int zend_do_begin_class_member_function if (method_name->op_type == IS_CONST) { char *lcname; if (Z_TYPE(method_name->u.constant) != IS_STRING) { - zend_error(E_COMPILE_ERROR, "Method name must be a string"); + zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string"); } - lcname = zend_str_tolower_dup(Z_STRVAL(method_name->u.constant), Z_STRLEN(method_name->u.constant)); - if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(method_name->u.constant) && + lcname = zend_str_tolower_dup(Z_STRVAL(method_name->u.constant), Z_STRSIZE(method_name->u.constant)); + if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRSIZE(method_name->u.constant) && memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) { zval_dtor(&method_name->u.constant); method_name->op_type = IS_UNUSED; @@@ -4106,10 -4107,10 +4107,10 @@@ static void zend_traits_init_trait_stru j = 0; while (cur_precedence->exclude_from_classes[j]) { char* class_name = (char*)cur_precedence->exclude_from_classes[j]; - zend_uint name_length = strlen(class_name); + zend_str_size name_length = strlen(class_name); if (!(cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error(E_COMPILE_ERROR, "Could not find trait %s", class_name); + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name); } zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j] TSRMLS_CC); @@@ -4531,8 -4532,8 +4532,8 @@@ ZEND_API zend_class_entry *do_bind_clas op1 = opline->op1.zv; op2 = opline->op2.zv; } - if (zend_hash_quick_find(class_table, Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_HASH_P(op1), (void **) &pce)==FAILURE) { + if (zend_hash_quick_find(class_table, Z_STRVAL_P(op1), Z_STRSIZE_P(op1), Z_HASH_P(op1), (void **) &pce)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1)); + zend_error_noreturn(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1)); return NULL; } else { ce = *pce; @@@ -4599,8 -4600,8 +4600,8 @@@ ZEND_API zend_class_entry *do_bind_inhe ce->refcount++; /* Register the derived class */ - if (zend_hash_quick_add(class_table, Z_STRVAL_P(op2), Z_STRLEN_P(op2)+1, Z_HASH_P(op2), pce, sizeof(zend_class_entry *), NULL)==FAILURE) { + if (zend_hash_quick_add(class_table, Z_STRVAL_P(op2), Z_STRSIZE_P(op2)+1, Z_HASH_P(op2), pce, sizeof(zend_class_entry *), NULL)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); } return ce; } @@@ -4992,11 -4993,11 +4993,11 @@@ void zend_do_begin_class_declaration(co } if (error) { - char *tmp = zend_str_tolower_dup(Z_STRVAL_PP(ns_name), Z_STRLEN_PP(ns_name)); + char *tmp = zend_str_tolower_dup(Z_STRVAL_PP(ns_name), Z_STRSIZE_PP(ns_name)); - if (Z_STRLEN_PP(ns_name) != Z_STRLEN(class_name->u.constant) || + if (Z_STRSIZE_PP(ns_name) != Z_STRSIZE(class_name->u.constant) || - memcmp(tmp, lcname, Z_STRSIZE(class_name->u.constant))) { - zend_error(E_COMPILE_ERROR, "Cannot declare class %s because the name is already in use", Z_STRVAL(class_name->u.constant)); + memcmp(tmp, lcname, Z_STRLEN(class_name->u.constant))) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s because the name is already in use", Z_STRVAL(class_name->u.constant)); } efree(tmp); } @@@ -5272,10 -5273,10 +5273,10 @@@ void zend_do_declare_property(const zno zval *property; zend_property_info *existing_property_info; char *comment = NULL; - int comment_len = 0; + zend_str_size comment_len = 0; if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) { - zend_error(E_COMPILE_ERROR, "Interfaces may not include member variables"); + zend_error_noreturn(E_COMPILE_ERROR, "Interfaces may not include member variables"); } if (access_type & ZEND_ACC_ABSTRACT) { @@@ -5287,8 -5288,8 +5288,8 @@@ CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } - if (zend_hash_find(&CG(active_class_entry)->properties_info, Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, (void **) &existing_property_info)==SUCCESS) { + if (zend_hash_find(&CG(active_class_entry)->properties_info, Z_STRVAL(var_name->u.constant), Z_STRSIZE(var_name->u.constant)+1, (void **) &existing_property_info)==SUCCESS) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } ALLOC_ZVAL(property); @@@ -5329,11 -5330,11 +5330,11 @@@ void zend_do_declare_class_constant(zno ALLOC_ZVAL(property); *property = value->u.constant; - cname = zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, 0 TSRMLS_CC); - hash = str_hash(cname, Z_STRLEN(var_name->u.constant)); - if (zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, Z_STRLEN(var_name->u.constant)+1, hash, &property, sizeof(zval *), NULL) == FAILURE) { + cname = zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRSIZE(var_name->u.constant)+1, 0 TSRMLS_CC); + hash = str_hash(cname, Z_STRSIZE(var_name->u.constant)); + if (zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, Z_STRSIZE(var_name->u.constant)+1, hash, &property, sizeof(zval *), NULL) == FAILURE) { FREE_ZVAL(property); - zend_error(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } FREE_PNODE(var_name); @@@ -5424,10 -5425,10 +5425,10 @@@ void zend_do_halt_compiler_register(TSR { char *name, *cfilename; char haltoff[] = "__COMPILER_HALT_OFFSET__"; - int len, clen; + zend_str_size len, clen; if (CG(has_bracketed_namespaces) && CG(in_namespace)) { - zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); + zend_error_noreturn(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } cfilename = zend_get_compiled_filename(TSRMLS_C); @@@ -6001,9 -6002,9 +6002,9 @@@ void zend_do_fetch_lexical_variable(zno { znode value; - if (Z_STRLEN(varname->u.constant) == sizeof("this") - 1 && + if (Z_STRSIZE(varname->u.constant) == sizeof("this") - 1 && memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this") - 1) == 0) { - zend_error(E_COMPILE_ERROR, "Cannot use $this as lexical variable"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as lexical variable"); return; } @@@ -6385,12 -6386,12 +6386,12 @@@ void zend_do_declare_begin(TSRMLS_D) / void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ { - if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "ticks", sizeof("ticks")-1)) { + if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRSIZE(var->u.constant), "ticks", sizeof("ticks")-1)) { convert_to_long(&val->u.constant); CG(declarables).ticks = val->u.constant; - } else if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "encoding", sizeof("encoding")-1)) { + } else if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRSIZE(var->u.constant), "encoding", sizeof("encoding")-1)) { if ((Z_TYPE(val->u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { - zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use constants as encoding"); } /* @@@ -6936,12 -6937,12 +6937,12 @@@ void zend_do_begin_namespace(const znod } if (name) { - lcname = zend_str_tolower_dup(Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)); - if (((Z_STRLEN(name->u.constant) == sizeof("self")-1) && + lcname = zend_str_tolower_dup(Z_STRVAL(name->u.constant), Z_STRSIZE(name->u.constant)); + if (((Z_STRSIZE(name->u.constant) == sizeof("self")-1) && !memcmp(lcname, "self", sizeof("self")-1)) || - ((Z_STRLEN(name->u.constant) == sizeof("parent")-1) && + ((Z_STRSIZE(name->u.constant) == sizeof("parent")-1) && !memcmp(lcname, "parent", sizeof("parent")-1))) { - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", Z_STRVAL(name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", Z_STRVAL(name->u.constant)); } efree(lcname); @@@ -7005,46 -7006,46 +7006,46 @@@ void zend_do_use(znode *ns_name, znode } } - lcname = zend_str_tolower_dup(Z_STRVAL_P(name), Z_STRLEN_P(name)); + lcname = zend_str_tolower_dup(Z_STRVAL_P(name), Z_STRSIZE_P(name)); - if (((Z_STRLEN_P(name) == sizeof("self")-1) && + if (((Z_STRSIZE_P(name) == sizeof("self")-1) && !memcmp(lcname, "self", sizeof("self")-1)) || - ((Z_STRLEN_P(name) == sizeof("parent")-1) && + ((Z_STRSIZE_P(name) == sizeof("parent")-1) && !memcmp(lcname, "parent", sizeof("parent")-1))) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name)); } if (CG(current_namespace)) { /* Prefix import name with current namespace name to avoid conflicts with classes */ - char *c_ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) + 1); + char *c_ns_name = emalloc(Z_STRSIZE_P(CG(current_namespace)) + 1 + Z_STRSIZE_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 *tmp2 = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns)); + zend_str_tolower_copy(c_ns_name, Z_STRVAL_P(CG(current_namespace)), Z_STRSIZE_P(CG(current_namespace))); + c_ns_name[Z_STRSIZE_P(CG(current_namespace))] = '\\'; + memcpy(c_ns_name+Z_STRSIZE_P(CG(current_namespace))+1, lcname, Z_STRSIZE_P(name)+1); + if (zend_hash_exists(CG(class_table), c_ns_name, Z_STRSIZE_P(CG(current_namespace)) + 1 + Z_STRSIZE_P(name)+1)) { + char *tmp2 = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRSIZE_P(ns)); - if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) || - memcmp(tmp2, c_ns_name, Z_STRLEN_P(ns))) { + if (Z_STRSIZE_P(ns) != Z_STRSIZE_P(CG(current_namespace)) + 1 + Z_STRSIZE_P(name) || + memcmp(tmp2, c_ns_name, Z_STRSIZE_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_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } efree(tmp2); } 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_STRSIZE_P(name)+1, (void**)&pce) == SUCCESS && (*pce)->type == ZEND_USER_CLASS && (*pce)->info.user.filename == CG(compiled_filename)) { - char *c_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_STRSIZE_P(ns)); - if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) || - memcmp(c_tmp, lcname, Z_STRLEN_P(ns))) { + if (Z_STRSIZE_P(ns) != Z_STRSIZE_P(name) || + memcmp(c_tmp, lcname, Z_STRSIZE_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_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } efree(c_tmp); } - if (zend_hash_add(CG(current_import), lcname, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) { + if (zend_hash_add(CG(current_import), lcname, Z_STRSIZE_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) { - 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_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } if (warn) { if (!strcmp(Z_STRVAL_P(name), "strict")) { diff --cc ext/intl/collator/collator_create.c index 11ae015,7ed4c53..7129def --- a/ext/intl/collator/collator_create.c +++ b/ext/intl/collator/collator_create.c @@@ -27,8 -27,8 +27,8 @@@ /* {{{ */ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS) { - char* locale; + const char* locale; - int locale_len = 0; + zend_str_size_int locale_len = 0; zval* object; Collator_object* co; diff --cc ext/intl/dateformat/dateformat_parse.c index 4f98046,9930778..346e5b7 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@@ -83,9 -83,9 +83,9 @@@ static void add_to_localtime_arr( IntlD */ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC) { - UCalendar* parsed_calendar = NULL; + UCalendar *parsed_calendar = NULL; UChar* text_utf16 = NULL; - int32_t text_utf16_len = 0; + zend_str_size_int text_utf16_len = 0; long isInDST = 0; /* Convert timezone to UTF-16. */ diff --cc ext/intl/formatter/formatter_main.c index 85c7a62,0a56847..e45c427 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@@ -27,12 -27,12 +27,12 @@@ /* {{{ */ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) { - char* locale; + const char* locale; char* pattern = NULL; - int locale_len = 0, pattern_len = 0; + zend_str_size_int locale_len = 0, pattern_len = 0; long style; UChar* spattern = NULL; - int spattern_len = 0; + zend_str_size_int spattern_len = 0; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ diff --cc ext/intl/locale/locale_methods.c index 755b37f,21b5847..5f426ae --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@@ -367,8 -370,8 +370,8 @@@ static char* get_icu_value_internal( co static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { - char* loc_name = NULL; + const char* loc_name = NULL; - int loc_name_len = 0; + zend_str_size_int loc_name_len = 0; char* tag_value = NULL; char* empty_result = ""; @@@ -462,11 -465,11 +465,11 @@@ PHP_FUNCTION(locale_get_primary_languag }}} */ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { - char* loc_name = NULL; + const char* loc_name = NULL; - int loc_name_len = 0; + zend_str_size_int loc_name_len = 0; - char* disp_loc_name = NULL; + const char* disp_loc_name = NULL; - int disp_loc_name_len = 0; + zend_str_size_int disp_loc_name_len = 0; int free_loc_name = 0; UChar* disp_name = NULL; @@@ -663,11 -666,11 +666,11 @@@ PHP_FUNCTION( locale_get_keywords UEnumeration* e = NULL; UErrorCode status = U_ZERO_ERROR; - const char* kw_key = NULL; + const char* kw_key = NULL; int32_t kw_key_len = 0; - char* loc_name = NULL; + const char* loc_name = NULL; - int loc_name_len = 0; + zend_str_size_int loc_name_len = 0; /* ICU expects the buffer to be allocated before calling the function @@@ -1081,8 -1084,8 +1084,8 @@@ static int add_array_entry(const char* */ PHP_FUNCTION(locale_parse) { - char* loc_name = NULL; + const char* loc_name = NULL; - int loc_name_len = 0; + zend_str_size_int loc_name_len = 0; int grOffset = 0; intl_error_reset( NULL TSRMLS_CC ); @@@ -1125,8 -1128,8 +1128,8 @@@ */ PHP_FUNCTION(locale_get_all_variants) { - char* loc_name = NULL; - zend_str_size_int loc_name_len = 0; + const char* loc_name = NULL; - int loc_name_len = 0; ++ zend_str_size_int loc_name_len = 0; int result = 0; char* token = NULL; @@@ -1221,9 -1224,9 +1224,9 @@@ static int strToMatch(const char* str , PHP_FUNCTION(locale_filter_matches) { char* lang_tag = NULL; - int lang_tag_len = 0; + zend_str_size_int lang_tag_len = 0; - char* loc_range = NULL; + const char* loc_range = NULL; - int loc_range_len = 0; + zend_str_size_int loc_range_len = 0; int result = 0; char* token = 0; @@@ -1519,9 -1522,9 +1522,9 @@@ static char* lookup_loc_range(const cha PHP_FUNCTION(locale_lookup) { char* fallback_loc = NULL; - int fallback_loc_len = 0; + zend_str_size_int fallback_loc_len = 0; - char* loc_range = NULL; + const char* loc_range = NULL; - int loc_range_len = 0; + zend_str_size_int loc_range_len = 0; zval* arr = NULL; HashTable* hash_arr = NULL; diff --cc ext/intl/msgformat/msgformat.c index 05f6552,7d8cd95..5edb7d7 --- a/ext/intl/msgformat/msgformat.c +++ b/ext/intl/msgformat/msgformat.c @@@ -28,11 -28,11 +28,11 @@@ /* {{{ */ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) { - char* locale; + const char* locale; char* pattern; - int locale_len = 0, pattern_len = 0; + zend_str_size_int locale_len = 0, pattern_len = 0; UChar* spattern = NULL; - int spattern_len = 0; + zend_str_size_int spattern_len = 0; zval* object; MessageFormatter_object* mfo; intl_error_reset( NULL TSRMLS_CC ); diff --cc ext/intl/msgformat/msgformat_format.c index 1eb68f3,55ec9e8..69703c9 --- a/ext/intl/msgformat/msgformat_format.c +++ b/ext/intl/msgformat/msgformat_format.c @@@ -100,11 -100,11 +100,11 @@@ PHP_FUNCTION( msgfmt_format_message { zval *args; UChar *spattern = NULL; - int spattern_len = 0; + zend_str_size_int spattern_len = 0; char *pattern = NULL; - int pattern_len = 0; + zend_str_size_int pattern_len = 0; - char *slocale = NULL; + const char *slocale = NULL; - int slocale_len = 0; + zend_str_size_int slocale_len = 0; MessageFormatter_object mf = {0}; MessageFormatter_object *mfo = &mf; diff --cc ext/intl/msgformat/msgformat_parse.c index 9f09050,14a6363..5f12993 --- a/ext/intl/msgformat/msgformat_parse.c +++ b/ext/intl/msgformat/msgformat_parse.c @@@ -90,13 -90,13 +90,13 @@@ PHP_FUNCTION( msgfmt_parse PHP_FUNCTION( msgfmt_parse_message ) { UChar *spattern = NULL; - int spattern_len = 0; + zend_str_size_int spattern_len = 0; char *pattern = NULL; - int pattern_len = 0; + zend_str_size_int pattern_len = 0; - char *slocale = NULL; + const char *slocale = NULL; - int slocale_len = 0; + zend_str_size_int slocale_len = 0; char *source = NULL; - int src_len = 0; + zend_str_size_int src_len = 0; MessageFormatter_object mf = {0}; MessageFormatter_object *mfo = &mf;
« previous php.cvs (#73804) next »