1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 14:31:06 +02:00

Fixed bug #64515 (Memoryleak when using the same variablename 2times in function declaration)

This commit is contained in:
Xinchen Hui
2013-03-26 11:44:57 +08:00
parent e9f996c00d
commit 5e9377ebd5
4 changed files with 14 additions and 2 deletions

2
NEWS
View File

@@ -2,6 +2,8 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.4.14
- Core
. Fixed bug #64515 (Memoryleak when using the same variablename 2times in
function declaration). (Laruence)
. Fixed bug #64432 (more empty delimiter warning in strX methods). (Laruence)
. Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error).
(Dmitry)

10
Zend/tests/bug64515.phpt Normal file
View File

@@ -0,0 +1,10 @@
--TEST--
Bug #64515 (Memoryleak when using the same variablename 2times in function declaration)
--FILE--
<?php
function foo($unused = null, $unused = null, $arg = array()) {
return 1;
}
foo();
?>
--EXPECT--

View File

@@ -3234,7 +3234,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC);
Z_DELREF_PP(var_ptr);
zval_ptr_dtor(var_ptr);
*var_ptr = assignment_value;
CHECK_EXCEPTION();

View File

@@ -1374,7 +1374,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC);
Z_DELREF_PP(var_ptr);
zval_ptr_dtor(var_ptr);
*var_ptr = assignment_value;
CHECK_EXCEPTION();