-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-13817: Segmentation fault for enabled observers after pass 4
Instead of fixing up temporaries count in between observer steps, just apply the additional temporary in the two affected observer steps. Closes GH-14018.
- Loading branch information
Showing
5 changed files
with
59 additions
and
15 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
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
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,51 @@ | ||
--TEST-- | ||
GH-13712 (Segmentation fault for enabled observers after pass 4) | ||
--EXTENSIONS-- | ||
opcache | ||
zend_test | ||
--INI-- | ||
zend_test.observer.enabled=1 | ||
zend_test.observer.show_output=1 | ||
zend_test.observer.observe_all=1 | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.optimization_level=0x4069 | ||
--FILE-- | ||
<?php | ||
|
||
function inner() { | ||
echo "Ok\n"; | ||
} | ||
|
||
function foo() { | ||
// If stack size is wrong, inner() will corrupt the previous observed frame | ||
inner(); | ||
} | ||
|
||
// After foo() def so that we land here, with step_two undone for foo() first | ||
function outer() { | ||
// Pass 15 does constant string propagation, which gives a ZEND_INIT_DYNAMIC_FCALL on a const which Pass 4 will optimize | ||
// Pass 4 must calc the right stack size here | ||
(NAME)(); | ||
} | ||
|
||
const NAME = "foo"; | ||
|
||
outer(); | ||
|
||
?> | ||
--EXPECTF-- | ||
<!-- init '%s' --> | ||
<file '%s'> | ||
<!-- init outer() --> | ||
<outer> | ||
<!-- init foo() --> | ||
<foo> | ||
<!-- init inner() --> | ||
<inner> | ||
Ok | ||
</inner> | ||
</foo> | ||
</outer> | ||
</file '%s'> | ||
|