mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix GH-17216: Trampoline crash on error
This commit is contained in:
22
Zend/tests/named_params/gh17216.phpt
Normal file
22
Zend/tests/named_params/gh17216.phpt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
--TEST--
|
||||||
|
GH-17216 (Trampoline crash on error)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
class TrampolineTest {
|
||||||
|
public function __call(string $name, array $arguments) {
|
||||||
|
var_dump($name, $arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$o = new TrampolineTest();
|
||||||
|
$callback = [$o, 'trampoline'];
|
||||||
|
$array = ["a" => "b", 1];
|
||||||
|
try {
|
||||||
|
forward_static_call_array($callback, $array);
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
echo "Done\n";
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
Cannot use positional argument after named argument
|
||||||
|
Done
|
||||||
@@ -884,7 +884,11 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_
|
|||||||
ZEND_CALL_NUM_ARGS(call) = i;
|
ZEND_CALL_NUM_ARGS(call) = i;
|
||||||
cleanup_args:
|
cleanup_args:
|
||||||
zend_vm_stack_free_args(call);
|
zend_vm_stack_free_args(call);
|
||||||
|
if (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) {
|
||||||
|
zend_free_extra_named_params(call->extra_named_params);
|
||||||
|
}
|
||||||
zend_vm_stack_free_call_frame(call);
|
zend_vm_stack_free_call_frame(call);
|
||||||
|
zend_release_fcall_info_cache(fci_cache);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user