summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2013-03-26 11:44:57 +0800
committerXinchen Hui <laruence@php.net>2013-03-26 11:44:57 +0800
commit5e9377ebd57f419de7b421878df540795ace01ef (patch)
tree6516c311c7c0277060ee267704312818661fbf33
parente9f996c00d5cb6448dac1457dd9dae320c16904f (diff)
downloadphp-git-5e9377ebd57f419de7b421878df540795ace01ef.tar.gz
Fixed bug #64515 (Memoryleak when using the same variablename 2times in function declaration)
-rw-r--r--NEWS2
-rw-r--r--Zend/tests/bug64515.phpt10
-rw-r--r--Zend/zend_vm_def.h2
-rw-r--r--Zend/zend_vm_execute.h2
4 files changed, 14 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index c14ea1cc87..010b8f11ab 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/Zend/tests/bug64515.phpt b/Zend/tests/bug64515.phpt
new file mode 100644
index 0000000000..d056c74431
--- /dev/null
+++ b/Zend/tests/bug64515.phpt
@@ -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--
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index ffa94a1862..393475259e 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -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();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 1860a0f9ba..81d3688830 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -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();