mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
commit
48a247178e
2
NEWS
2
NEWS
@ -17,6 +17,8 @@ PHP NEWS
|
||||
static variable). (Nikita)
|
||||
. Fixed bug #79779 (Assertion failure when assigning property of string
|
||||
offset by reference). (Nikita)
|
||||
. Fixed bug #79792 (HT iterators not removed if empty array is destroyed).
|
||||
(Nikita)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #79756 (finfo_file crash (FILEINFO_MIME)). (cmb)
|
||||
|
16
Zend/tests/bug79792.phpt
Normal file
16
Zend/tests/bug79792.phpt
Normal file
@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #79792: HT iterators not removed if empty array is destroyed
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [42];
|
||||
foreach ($a as &$c) {
|
||||
// Make the array empty.
|
||||
unset($a[0]);
|
||||
// Destroy the array.
|
||||
$a = null;
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: Invalid argument supplied for foreach() in %s on line %d
|
||||
===DONE===
|
@ -1627,11 +1627,11 @@ ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
|
||||
}
|
||||
} while (++p != end);
|
||||
}
|
||||
zend_hash_iterators_remove(ht);
|
||||
SET_INCONSISTENT(HT_DESTROYED);
|
||||
} else if (EXPECTED(HT_FLAGS(ht) & HASH_FLAG_UNINITIALIZED)) {
|
||||
goto free_ht;
|
||||
}
|
||||
zend_hash_iterators_remove(ht);
|
||||
SET_INCONSISTENT(HT_DESTROYED);
|
||||
efree(HT_GET_DATA_ADDR(ht));
|
||||
free_ht:
|
||||
FREE_HASHTABLE(ht);
|
||||
|
Loading…
Reference in New Issue
Block a user