php-src/Zend/tests/gc_044.phpt
Nikita Popov 5f8ed7765a Fix GC of object properties HT
We partially fixed this in bug #78379, but still don't handle
the case where the properties array is marked as grey first,
which causes a delref to not be performed later.

Fix this by treating the object properties HT the same way as
other refcounted values, including addrefs/delrefs. The object
dtor code already handles properties HT with NULL GC type, so
out of order destruction should not be a problem.

Fixes oss-fuzz #36023.
2021-07-12 11:30:20 +02:00

17 lines
248 B
PHP

--TEST--
GC of object property table (order variation)
--FILE--
<?php
function test() {
$o1 = new stdClass;
$o2 = new stdClass;
$a = ['prop' => $o2];
$o = $o1;
$o2->a = (object) $a;
}
test();
?>
===DONE===
--EXPECT--
===DONE===