diff options
author | Xinchen Hui <laruence@gmail.com> | 2015-11-11 12:31:45 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2015-11-11 12:32:46 +0800 |
commit | 82f503f5874a6d1d632ccf7c4b4ad3df20f9ba39 (patch) | |
tree | 7cfbd1b39faf091b119986fe10133ed2da153512 /Zend/zend_hash.c | |
parent | c3260b66c9723d63c75f4f63aa2b9f52c6915d6f (diff) | |
download | php-git-82f503f5874a6d1d632ccf7c4b4ad3df20f9ba39.tar.gz |
Re-Fixed bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)
Let's fixed this in the root instead
Diffstat (limited to 'Zend/zend_hash.c')
-rw-r--r-- | Zend/zend_hash.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 52868cf4a6..c324f1dfa8 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -1458,8 +1458,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu HT_ASSERT(GC_REFCOUNT(ht) == 1); HASH_PROTECT_RECURSION(ht); - p = ht->arData; - for (idx = 0; idx < ht->nNumUsed; idx++, p++) { + for (idx = 0; idx < ht->nNumUsed; idx++) { + p = ht->arData + idx; if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; result = apply_func(&p->val); @@ -1484,8 +1484,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_f HT_ASSERT(GC_REFCOUNT(ht) == 1); HASH_PROTECT_RECURSION(ht); - p = ht->arData; - for (idx = 0; idx < ht->nNumUsed; idx++, p++) { + for (idx = 0; idx < ht->nNumUsed; idx++) { + p = ht->arData + idx; if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; result = apply_func(&p->val, argument); @@ -1513,8 +1513,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_ HASH_PROTECT_RECURSION(ht); - p = ht->arData; - for (idx = 0; idx < ht->nNumUsed; idx++, p++) { + for (idx = 0; idx < ht->nNumUsed; idx++) { + p = ht->arData + idx; if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; va_start(args, num_args); hash_key.h = p->h; @@ -1547,10 +1547,9 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t HASH_PROTECT_RECURSION(ht); idx = ht->nNumUsed; - p = ht->arData + idx; while (idx > 0) { idx--; - p--; + p = ht->arData + idx; if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; result = apply_func(&p->val); |