mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
14
Zend/tests/bug80049.phpt
Normal file
14
Zend/tests/bug80049.phpt
Normal file
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #80049: Memleak when coercing integers to string via variadic argument
|
||||
--FILE--
|
||||
<?php
|
||||
function coerceToString(string ...$strings) {
|
||||
var_dump($strings);
|
||||
}
|
||||
coerceToString(...[123]);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "123"
|
||||
}
|
||||
@@ -5463,6 +5463,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, NUM, UNUSED, CACHE_SLOT)
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(params)) {
|
||||
zval *param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
|
||||
if (UNEXPECTED(ZEND_TYPE_IS_SET(arg_info->type))) {
|
||||
ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS);
|
||||
do {
|
||||
if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) {
|
||||
ZEND_HASH_FILL_FINISH();
|
||||
|
||||
@@ -3907,6 +3907,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_UNUSED_HAND
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(params)) {
|
||||
zval *param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
|
||||
if (UNEXPECTED(ZEND_TYPE_IS_SET(arg_info->type))) {
|
||||
ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS);
|
||||
do {
|
||||
if (UNEXPECTED(!zend_verify_variadic_arg_type(EX(func), arg_info, arg_num, param, CACHE_ADDR(opline->extended_value)))) {
|
||||
ZEND_HASH_FILL_FINISH();
|
||||
|
||||
Reference in New Issue
Block a user