1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/Zend/tests/weakrefs/weakmap_nested.phpt
Nikita Popov 8653174539 Fix nested WeakMap destruction
This undoes the change from a4b209fdcf
and addresses the original problem by dropping the unrefs during
shutdown. All objects should get unref'ed without that, and this
code path should only get hit for dangling references due to
bailout.

Alternatively we'd have to relax some assertions that check that the
object is part of the weakrefs table, which seems worse.

Fixes oss-fuzz #40090.
2021-10-19 11:40:19 +02:00

16 lines
221 B
PHP

--TEST--
Nested WeakMap for same object key
--FILE--
<?php
$obj = new stdClass;
$map = new WeakMap;
$map2 = new WeakMap;
$map[$obj] = $map2;
$map2[$obj] = 1;
unset($map2);
unset($obj);
?>
===DONE===
--EXPECT--
===DONE===