Skip to content

Commit 4393198

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix missing handling of CALLABLE_CONVERT in cleanup_unfinished_calls()
2 parents 353571e + b3e26c3 commit 4393198

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ PHP NEWS
1111
Zend/zend_opcode.c). (nielsdos)
1212
. Fixed bug GH-13942 (Align the behavior of zend-max-execution-timers with
1313
other timeout implementations). (Kévin Dunglas)
14+
. Fixed bug GH-14003 (Broken cleanup of unfinished calls with callable convert
15+
parameters). (ilutov)
1416

1517
- Fibers:
1618
. Fixed bug GH-13903 (ASAN false positive underflow when executing copy()).

Zend/tests/gh14003.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
GH-14003: Missing handling of CALLABLE_CONVERT in cleanup_unfinished_calls()
3+
--FILE--
4+
<?php
5+
6+
function foo(string $key): string {
7+
throw new \Exception('Test');
8+
}
9+
10+
array_filter(
11+
array_combine(
12+
['a'],
13+
array_map(foo(...), ['a']),
14+
),
15+
);
16+
17+
?>
18+
--EXPECTF--
19+
Fatal error: Uncaught Exception: Test in %s:%d
20+
Stack trace:
21+
#0 [internal function]: foo('a')
22+
#1 %s(%d): array_map(Object(Closure), Array)
23+
#2 {main}
24+
thrown in %s on line %d

Zend/zend_execute.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4231,6 +4231,7 @@ ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_exe
42314231
case ZEND_DO_ICALL:
42324232
case ZEND_DO_UCALL:
42334233
case ZEND_DO_FCALL_BY_NAME:
4234+
case ZEND_CALLABLE_CONVERT:
42344235
level++;
42354236
break;
42364237
case ZEND_INIT_FCALL:
@@ -4286,6 +4287,7 @@ ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_exe
42864287
case ZEND_DO_ICALL:
42874288
case ZEND_DO_UCALL:
42884289
case ZEND_DO_FCALL_BY_NAME:
4290+
case ZEND_CALLABLE_CONVERT:
42894291
level++;
42904292
break;
42914293
case ZEND_INIT_FCALL:
@@ -4364,6 +4366,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
43644366
case ZEND_DO_ICALL:
43654367
case ZEND_DO_UCALL:
43664368
case ZEND_DO_FCALL_BY_NAME:
4369+
case ZEND_CALLABLE_CONVERT:
43674370
level++;
43684371
break;
43694372
case ZEND_INIT_FCALL:
@@ -4419,6 +4422,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
44194422
case ZEND_DO_ICALL:
44204423
case ZEND_DO_UCALL:
44214424
case ZEND_DO_FCALL_BY_NAME:
4425+
case ZEND_CALLABLE_CONVERT:
44224426
level++;
44234427
break;
44244428
case ZEND_INIT_FCALL:

0 commit comments

Comments
 (0)