Merge branch 'PHP-8.3'

* PHP-8.3:
  Fix missing handling of CALLABLE_CONVERT in cleanup_unfinished_calls()
This commit is contained in:
Ilija Tovilo 2024-04-19 20:06:27 +02:00
commit 8160869e3d
No known key found for this signature in database
GPG Key ID: A4F5D403F118200A
2 changed files with 28 additions and 0 deletions

24
Zend/tests/gh14003.phpt Normal file
View File

@ -0,0 +1,24 @@
--TEST--
GH-14003: Missing handling of CALLABLE_CONVERT in cleanup_unfinished_calls()
--FILE--
<?php
function foo(string $key): string {
throw new \Exception('Test');
}
array_filter(
array_combine(
['a'],
array_map(foo(...), ['a']),
),
);
?>
--EXPECTF--
Fatal error: Uncaught Exception: Test in %s:%d
Stack trace:
#0 [internal function]: foo('a')
#1 %s(%d): array_map(Object(Closure), Array)
#2 {main}
thrown in %s on line %d

View File

@ -4233,6 +4233,7 @@ ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_exe
case ZEND_DO_ICALL:
case ZEND_DO_UCALL:
case ZEND_DO_FCALL_BY_NAME:
case ZEND_CALLABLE_CONVERT:
level++;
break;
case ZEND_INIT_FCALL:
@ -4288,6 +4289,7 @@ ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_exe
case ZEND_DO_ICALL:
case ZEND_DO_UCALL:
case ZEND_DO_FCALL_BY_NAME:
case ZEND_CALLABLE_CONVERT:
level++;
break;
case ZEND_INIT_FCALL:
@ -4366,6 +4368,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
case ZEND_DO_ICALL:
case ZEND_DO_UCALL:
case ZEND_DO_FCALL_BY_NAME:
case ZEND_CALLABLE_CONVERT:
level++;
break;
case ZEND_INIT_FCALL:
@ -4421,6 +4424,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
case ZEND_DO_ICALL:
case ZEND_DO_UCALL:
case ZEND_DO_FCALL_BY_NAME:
case ZEND_CALLABLE_CONVERT:
level++;
break;
case ZEND_INIT_FCALL: