forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug #63830: Segfault on undefined function call in nested generator
This also reverses the destruction order of the pushed arguments to align with how it is done everywhere else. I'm not exactly sure whether this is the right way to fix it, but it seems to work fine.
- Loading branch information
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--TEST-- | ||
Test nested calls with die() in a generator | ||
--FILE-- | ||
<?php | ||
|
||
function gen() { | ||
die('Test'); | ||
yield; // force generator | ||
} | ||
|
||
function function_with_3_args() { | ||
$gen = gen(); | ||
$gen->rewind(); | ||
} | ||
|
||
function function_with_4_args() { | ||
function_with_3_args(4, 5, 6); | ||
} | ||
|
||
function outerGen() { | ||
function_with_4_args(0, 1, 2, 3); | ||
yield; // force generator | ||
} | ||
|
||
$outerGen = outerGen(); | ||
$outerGen->rewind(); | ||
|
||
?> | ||
--EXPECT-- | ||
Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters