Commit: ed315823019c8111847fb9a24293dc758ead7c3a Author: Xinchen Hui <larue...@php.net> Tue, 26 Mar 2013 12:02:48 +0800 Parents: 0496ad31acf067910c9d17117290d168617f845a Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ed315823019c8111847fb9a24293dc758ead7c3a Log: Fixed bug #64515 (Memoryleak when using the same variablename 2times in function declaration) Bugs: https://bugs.php.net/64515 Changed paths: M NEWS A Zend/tests/bug64515.phpt M Zend/zend_vm_def.h M Zend/zend_vm_execute.h Diff: diff --git a/NEWS b/NEWS index 09ce1d1..e33c7a3 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 20??, PHP 5.5.0 Beta 2 - Core: + . Fixed bug #64515 (Memoryleak when using the same variablename 2times in + function declaration). (Laruence) . Fixed bug #64503 (Compilation fails with error: conflicting types for 'zendparse'). (Laruence) . Fixed bug #64239 (Debug backtrace changed behavior since 5.4.10 or 5.4.11). diff --git a/Zend/tests/bug64515.phpt b/Zend/tests/bug64515.phpt new file mode 100644 index 0000000..5390a6c --- /dev/null +++ b/Zend/tests/bug64515.phpt @@ -0,0 +1,12 @@ +--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(); +echo "okey"; +?> +--EXPECT-- +okey diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 31a5fac..7371d0e 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3262,7 +3262,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(execute_data, opline->result.var TSRMLS_CC); - Z_DELREF_PP(var_ptr); + zval_ptr_dtor(var_ptr); *var_ptr = assignment_value; CHECK_EXCEPTION(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 7fe6ee1..8703dec 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1406,7 +1406,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(execute_data, opline->result.var TSRMLS_CC); - Z_DELREF_PP(var_ptr); + zval_ptr_dtor(var_ptr); *var_ptr = assignment_value; CHECK_EXCEPTION(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php