File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 7
7
. Fixed bug #79650 (php-win.exe 100% cpu lockup). (cmb)
8
8
. Fixed bug #79668 (get_defined_functions(true) may miss functions). (cmb,
9
9
Nikita)
10
+ . Fixed bug #79657 ("yield from" hangs when invalid value encountered).
11
+ (Nikita)
10
12
11
13
- Filter:
12
14
. Fixed bug #73527 (Invalid memory access in php_filter_strip). (cmb)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #79657: "yield from" hangs when invalid value encountered
3
+ --FILE--
4
+ <?php
5
+
6
+ function throwException (): iterable
7
+ {
8
+ throw new Exception ();
9
+ }
10
+
11
+ function loop (): iterable
12
+ {
13
+ $ callbacks = [
14
+ function () {
15
+ yield 'first ' ;
16
+ },
17
+ function () {
18
+ yield from throwException ();
19
+ }
20
+ ];
21
+
22
+ foreach ($ callbacks as $ callback ) {
23
+ yield from $ callback ();
24
+ }
25
+ }
26
+
27
+ function get (string $ first , int $ second ): array
28
+ {
29
+ return [];
30
+ }
31
+
32
+ get (...loop ());
33
+
34
+ ?>
35
+ --EXPECTF--
36
+ Fatal error: Uncaught Exception in %s:%d
37
+ Stack trace:
38
+ #0 %s(%d): throwException()
39
+ #1 %s(%d): {closure}()
40
+ #2 %s(%d): loop()
41
+ #3 {main}
42
+ thrown in %s on line %d
Original file line number Diff line number Diff line change @@ -857,6 +857,7 @@ ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
857
857
} else {
858
858
generator = zend_generator_get_current (orig_generator );
859
859
zend_generator_throw_exception (generator , NULL );
860
+ orig_generator -> flags &= ~ZEND_GENERATOR_DO_INIT ;
860
861
goto try_again ;
861
862
}
862
863
}
You can’t perform that action at this time.
0 commit comments