mirror of
https://github.com/php/php-src.git
synced 2024-11-30 13:25:43 +08:00
commit
2dabc4c305
2
NEWS
2
NEWS
@ -8,6 +8,8 @@ PHP NEWS
|
||||
. Fixed bug #80037 (Typed property must not be accessed before initialization
|
||||
when __get() declared). (Nikita)
|
||||
. Fixed bug #80048 (Bug #69100 has not been fixed for Windows). (cmb)
|
||||
. Fixed bug #80049 (Memleak when coercing integers to string via variadic
|
||||
argument). (Nikita)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing).
|
||||
|
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"
|
||||
}
|
@ -5310,6 +5310,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, NUM, UNUSED|CACHE_SLOT)
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(params)) {
|
||||
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
|
||||
ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS);
|
||||
do {
|
||||
zend_verify_variadic_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num));
|
||||
if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param);
|
||||
|
@ -3192,6 +3192,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_UNUSED_HAND
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(params)) {
|
||||
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
|
||||
ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS);
|
||||
do {
|
||||
zend_verify_variadic_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num));
|
||||
if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param);
|
||||
|
Loading…
Reference in New Issue
Block a user