diff options
author | Joe Watkins <krakjoe@php.net> | 2016-04-29 13:05:44 +0100 |
---|---|---|
committer | Joe Watkins <krakjoe@php.net> | 2016-04-29 13:05:44 +0100 |
commit | 416e22d2bb496da39e95136b1eded64869f10dd0 (patch) | |
tree | b3867606a888d0ab96524c4243c3f33b3d138225 /Zend | |
parent | fdeb8a199e769068a0fe13b19ff58d01915e404c (diff) | |
parent | dbdc37ac4f440abade6f9560f093b9f8ef89db05 (diff) | |
download | php-git-416e22d2bb496da39e95136b1eded64869f10dd0.tar.gz |
Merge branch 'master' of https://github.com/php/php-src
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_builtin_functions.c | 6 | ||||
-rw-r--r-- | Zend/zend_compile.c | 6 | ||||
-rw-r--r-- | Zend/zend_exceptions.c | 9 | ||||
-rw-r--r-- | Zend/zend_generators.c | 7 | ||||
-rw-r--r-- | Zend/zend_hash.c | 8 | ||||
-rw-r--r-- | Zend/zend_opcode.c | 2 | ||||
-rw-r--r-- | Zend/zend_operators.c | 14 |
7 files changed, 28 insertions, 24 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 4492766117..e5f77d8960 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -526,13 +526,13 @@ ZEND_FUNCTION(func_get_arg) arg_count = ZEND_CALL_NUM_ARGS(ex); - if (requested_offset >= arg_count) { + if ((zend_ulong)requested_offset >= arg_count) { zend_error(E_WARNING, "func_get_arg(): Argument " ZEND_LONG_FMT " not passed to function", requested_offset); RETURN_FALSE; } first_extra_arg = ex->func->op_array.num_args; - if (requested_offset >= first_extra_arg && (ZEND_CALL_NUM_ARGS(ex) > first_extra_arg)) { + if ((zend_ulong)requested_offset >= first_extra_arg && (ZEND_CALL_NUM_ARGS(ex) > first_extra_arg)) { arg = ZEND_CALL_VAR_NUM(ex, ex->func->op_array.last_var + ex->func->op_array.T) + (requested_offset - first_extra_arg); } else { arg = ZEND_CALL_ARG(ex, requested_offset + 1); @@ -755,7 +755,7 @@ ZEND_FUNCTION(each) Return the current error_reporting level, and if an argument was passed - change to the new level */ ZEND_FUNCTION(error_reporting) { - zval *err; + zval *err = NULL; int old_error_reporting; #ifndef FAST_ZPP diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index b1f5768db9..c64e40bfd9 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7024,7 +7024,7 @@ void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */ /* Add a flag to INIT_ARRAY if we know this array cannot be packed */ if (!packed) { - ZEND_ASSERT(opnum_init != -1); + ZEND_ASSERT(opnum_init != (uint32_t)-1); opline = &CG(active_op_array)->opcodes[opnum_init]; opline->extended_value |= ZEND_ARRAY_NOT_PACKED; } @@ -7288,11 +7288,11 @@ static void zend_compile_encaps_list(znode *result, zend_ast *ast) /* {{{ */ while (opline != init_opline) { opline--; if (opline->opcode == ZEND_ROPE_ADD && - opline->result.var == -1) { + opline->result.var == (uint32_t)-1) { opline->op1.var = var; opline->result.var = var; } else if (opline->opcode == ZEND_ROPE_INIT && - opline->result.var == -1) { + opline->result.var == (uint32_t)-1) { opline->result.var = var; } } diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index f7081327f0..63bcca2640 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -662,14 +662,15 @@ ZEND_METHOD(exception, __toString) zend_class_entry *base_ce; zend_string *str; zend_fcall_info fci; - zval fname, rv; + zval rv; + zend_string *fname; DEFAULT_0_PARAMS; str = ZSTR_EMPTY_ALLOC(); exception = getThis(); - ZVAL_STRINGL(&fname, "gettraceasstring", sizeof("gettraceasstring")-1); + fname = zend_string_init("gettraceasstring", sizeof("gettraceasstring")-1, 0); while (exception && Z_TYPE_P(exception) == IS_OBJECT && instanceof_function(Z_OBJCE_P(exception), zend_ce_throwable)) { zend_string *prev_str = str; @@ -678,7 +679,7 @@ ZEND_METHOD(exception, __toString) zend_long line = zval_get_long(GET_PROPERTY(exception, "line")); fci.size = sizeof(fci); - ZVAL_COPY_VALUE(&fci.function_name, &fname); + ZVAL_STR(&fci.function_name, fname); fci.object = Z_OBJ_P(exception); fci.retval = &trace; fci.param_count = 0; @@ -719,7 +720,7 @@ ZEND_METHOD(exception, __toString) exception = GET_PROPERTY(exception, "previous"); } - zval_dtor(&fname); + zend_string_release(fname); exception = getThis(); base_ce = i_get_exception_base(exception); diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 457cea9f53..b4dfeba1da 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -827,7 +827,7 @@ try_again: } /* }}} */ -static void inline zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */ +static inline void zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */ { if (UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->execute_data) && EXPECTED(generator->node.parent == NULL)) { generator->flags |= ZEND_GENERATOR_DO_INIT; @@ -838,7 +838,7 @@ static void inline zend_generator_ensure_initialized(zend_generator *generator) } /* }}} */ -static void inline zend_generator_rewind(zend_generator *generator) /* {{{ */ +static inline void zend_generator_rewind(zend_generator *generator) /* {{{ */ { zend_generator_ensure_initialized(generator); @@ -1161,7 +1161,8 @@ static zend_object_iterator_funcs zend_generator_iterator_functions = { zend_generator_iterator_get_data, zend_generator_iterator_get_key, zend_generator_iterator_move_forward, - zend_generator_iterator_rewind + zend_generator_iterator_rewind, + NULL }; zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 5404187a97..e116ffe55e 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -92,7 +92,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin static void ZEND_FASTCALL zend_hash_do_resize(HashTable *ht); -static uint32_t zend_always_inline zend_hash_check_size(uint32_t nSize) +static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize) { #if defined(ZEND_WIN32) unsigned long index; @@ -127,7 +127,7 @@ static uint32_t zend_always_inline zend_hash_check_size(uint32_t nSize) #endif } -static void zend_always_inline zend_hash_real_init_ex(HashTable *ht, int packed) +static zend_always_inline void zend_hash_real_init_ex(HashTable *ht, int packed) { HT_ASSERT(GC_REFCOUNT(ht) == 1); ZEND_ASSERT(!((ht)->u.flags & HASH_FLAG_INITIALIZED)); @@ -139,7 +139,7 @@ static void zend_always_inline zend_hash_real_init_ex(HashTable *ht, int packed) (ht)->nTableMask = -(ht)->nTableSize; HT_SET_DATA_ADDR(ht, pemalloc(HT_SIZE(ht), (ht)->u.flags & HASH_FLAG_PERSISTENT)); (ht)->u.flags |= HASH_FLAG_INITIALIZED; - if (EXPECTED(ht->nTableMask == -8)) { + if (EXPECTED(ht->nTableMask == (uint32_t)-8)) { Bucket *arData = ht->arData; HT_HASH_EX(arData, -8) = -1; @@ -156,7 +156,7 @@ static void zend_always_inline zend_hash_real_init_ex(HashTable *ht, int packed) } } -static void zend_always_inline zend_hash_check_init(HashTable *ht, int packed) +static zend_always_inline void zend_hash_check_init(HashTable *ht, int packed) { HT_ASSERT(GC_REFCOUNT(ht) == 1); if (UNEXPECTED(!((ht)->u.flags & HASH_FLAG_INITIALIZED))) { diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 6c1488ad0c..27c04e3a76 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -736,7 +736,7 @@ ZEND_API int pass_two(zend_op_array *op_array) } if (op_array->live_range) { - uint32_t i; + int i; for (i = 0; i < op_array->last_live_range; i++) { op_array->live_range[i].var = diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index c1a7986650..e24d033da3 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -599,26 +599,26 @@ try_again: if (Z_OBJ_HT_P(op)->get_properties) { HashTable *obj_ht = Z_OBJ_HT_P(op)->get_properties(op); if (obj_ht) { - zval arr; + zend_array *arr; if (!Z_OBJCE_P(op)->default_properties_count && obj_ht == Z_OBJ_P(op)->properties && !ZEND_HASH_GET_APPLY_COUNT(Z_OBJ_P(op)->properties)) { /* fast copy */ if (EXPECTED(Z_OBJ_P(op)->handlers == &std_object_handlers)) { - ZVAL_ARR(&arr, obj_ht); + arr = obj_ht; if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(op)->properties) & IS_ARRAY_IMMUTABLE))) { GC_REFCOUNT(Z_OBJ_P(op)->properties)++; } } else { - ZVAL_ARR(&arr, zend_array_dup(obj_ht)); + arr = zend_array_dup(obj_ht); } zval_dtor(op); - ZVAL_COPY_VALUE(op, &arr); + ZVAL_ARR(op, arr); } else { - ZVAL_ARR(&arr, zend_array_dup(obj_ht)); + arr = zend_array_dup(obj_ht); zval_dtor(op); - ZVAL_COPY_VALUE(op, &arr); + ZVAL_ARR(op, arr); } return; } @@ -2932,6 +2932,8 @@ static zend_always_inline void zend_memnstr_ex_pre(unsigned int td[], const char td[(unsigned char)needle[i]] = i + 1; } } else { + size_t i; + for (i = 0; i < needle_len; i++) { td[(unsigned char)needle[i]] = (int)needle_len - i; } |