mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fixed incorrect tracked malloc deallocation
This commit is contained in:
commit
5abf4f232e
1 changed files with 7 additions and 0 deletions
|
@ -2432,6 +2432,13 @@ ZEND_API bool is_zend_ptr(const void *ptr)
|
|||
{
|
||||
#if ZEND_MM_CUSTOM
|
||||
if (AG(mm_heap)->use_custom_heap) {
|
||||
if (AG(mm_heap)->custom_heap.std._malloc == tracked_malloc) {
|
||||
zend_ulong h = ((uintptr_t) ptr) >> ZEND_MM_ALIGNMENT_LOG2;
|
||||
zval *size_zv = zend_hash_index_find(AG(mm_heap)->tracked_allocs, h);
|
||||
if (size_zv) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue