Skip to content

Commit 2f84241

Browse files
committed
ASAN support for the zend allocator
1 parent 2e2494f commit 2f84241

File tree

3 files changed

+416
-59
lines changed

3 files changed

+416
-59
lines changed

Zend/tests/gh18833.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Bug #18833 (Use after free with weakmaps dependent on destruction order)
3+
--FILE--
4+
<?php
5+
6+
class a {
7+
public static WeakMap $map;
8+
public static Generator $storage;
9+
}
10+
11+
a::$map = new WeakMap;
12+
13+
$closure = function () {
14+
$obj = new a;
15+
a::$map[$obj] = true;
16+
yield $obj;
17+
};
18+
a::$storage = $closure();
19+
a::$storage->current();
20+
21+
echo "ok\n";
22+
?>
23+
--EXPECT--
24+
ok

0 commit comments

Comments
 (0)