[php-src] PR #19544: Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes
| From: | arnaud-lb | Date: | Thu, 21 Aug 2025 15:05:27 +0000 |
| Subject: | [php-src] PR #19544: Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-32858@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/19544
Author: arnaud-lb
Possible fix for GH-19543.
Since https://github.com/php/php-src/commit/cbf67e4feee6b4a0eb23d3530efa58c682d081c5,
the GC needs to find all
WeakMaps referencing a weakly referenced object. Doing so, it
treats all ZEND_WEAKREF_TAG_MAP as WeakMap instances.
However, a ZEND_WEAKREF_TAG_MAP reference may be a bare HashTable when
zend_weakrefs_hash_add() is used.
Introduce a new tag, ZEND_WEAKREF_TAG_BARE_HT, and use this tag when weakly referencing
an object from a bare HashTable. Ignore such references in GC.
cc @bwoebi @TimWolla