summaryrefslogtreecommitdiff
path: root/Zend/tests/bug78752.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug78752.phpt')
-rw-r--r--Zend/tests/bug78752.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/tests/bug78752.phpt b/Zend/tests/bug78752.phpt
new file mode 100644
index 0000000000..367a44eab5
--- /dev/null
+++ b/Zend/tests/bug78752.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #78752: Segfault if GC triggered while generator stack frame is being destroyed
+--FILE--
+<?php
+
+function gen(&$gen) {
+ $a = new stdClass;
+ $a->a = $a;
+ $b = new stdClass;
+ $b->b = $b;
+ yield 1;
+}
+
+$gen = gen($gen);
+var_dump($gen->current());
+for ($i = 0; $i < 9999; $i++) {
+ $a = new stdClass;
+ $a->a = $a;
+}
+$gen->next();
+
+?>
+--EXPECT--
+int(1)