File tree Expand file tree Collapse file tree 3 files changed +45
-3
lines changed Expand file tree Collapse file tree 3 files changed +45
-3
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,14 @@ PHP NEWS
2
2
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3
3
?? ??? ????, PHP 7.4.7
4
4
5
-
6
- 28 May 2020, PHP 7.4.7RC1
7
-
8
5
- Core:
9
6
. Fixed bug #79599 (coredump in set_error_handler). (Laruence)
10
7
. Fixed bug #79566 (Private SHM is not private on Windows). (cmb)
11
8
. Fixed bug #79489 (.user.ini does not inherit). (cmb)
12
9
. Fixed bug #79600 (Regression in 7.4.6 when yielding an array based
13
10
generator). (Nikita)
11
+ . Fixed bug #79657 ("yield from" hangs when invalid value encountered).
12
+ (Nikita)
14
13
15
14
- FFI:
16
15
. Fixed bug #79571 (FFI: var_dumping unions may segfault). (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