[php-src] PR #11417: Fix GH-11406: segfault with unpacking and magic method closure
| From: | nielsdos | Date: | Fri, 09 Jun 2023 15:26:36 +0000 |
| Subject: | [php-src] PR #11417: Fix GH-11406: segfault with unpacking and magic method closure | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-22699@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11417
Author: nielsdos
The magic method trampoline closure may be variadic. However, the arg_info for the variadic argument
was not set, resulting in a crash both in reflection and in the VM.
Fix it by creating an arg_info containing a single element in case of the variadic case. The
variadic argument is the last one (and in this case only one) in the arg_info array.
We make sure the argument info is equivalent to the argument info of
$closure of the
following code snippet:
```
function foo(...$arguments) {}
$closure = foo(...);
```