Merge branch 'PHP-8.2'

* PHP-8.2:
  Fix incorrect CG(memoize_mode) state after bailout in ??=
This commit is contained in:
Ilija Tovilo 2023-04-20 19:46:34 +02:00
commit 6ca6b46234
No known key found for this signature in database
GPG Key ID: A4F5D403F118200A
4 changed files with 20 additions and 0 deletions

11
Zend/tests/gh11108.phpt Normal file
View File

@ -0,0 +1,11 @@
--TEST--
GH-11108: Incorrect CG(memoize_mode) state after bailout in ??=
--FILE--
<?php
register_shutdown_function(function() {
include __DIR__ . '/gh11108_shutdown.inc';
});
include __DIR__ . '/gh11108_test.inc';
?>
--EXPECTF--
Fatal error: Cannot use [] for reading in %s on line %d

View File

@ -0,0 +1,5 @@
<?php
function test() {
throw new Exception();
}

View File

@ -0,0 +1,3 @@
<?php
$messageList[] ??= true;

View File

@ -1190,6 +1190,7 @@ ZEND_API ZEND_COLD ZEND_NORETURN void _zend_bailout(const char *filename, uint32
CG(unclean_shutdown) = 1;
CG(active_class_entry) = NULL;
CG(in_compilation) = 0;
CG(memoize_mode) = 0;
EG(current_execute_data) = NULL;
LONGJMP(*EG(bailout), FAILURE);
}