Skip to content

Commit 6729276

Browse files
committed
Eliminate "h < ht->nNumUsed" check in zend_hash_next_index_insert_new()
1 parent 2e8904f commit 6729276

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Zend/zend_hash.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,8 @@ static zend_always_inline zval *_zend_hash_index_add_or_update_i(HashTable *ht,
999999
}
10001000

10011001
if (HT_FLAGS(ht) & HASH_FLAG_PACKED) {
1002-
if (h < ht->nNumUsed) {
1002+
if ((flag & (HASH_ADD_NEW|HASH_ADD_NEXT)) != (HASH_ADD_NEW|HASH_ADD_NEXT)
1003+
&& h < ht->nNumUsed) {
10031004
p = ht->arData + h;
10041005
if (Z_TYPE(p->val) != IS_UNDEF) {
10051006
if (flag & HASH_LOOKUP) {

0 commit comments

Comments
 (0)