Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug #64515 (Memoryleak when using the same variablename 2times …

…in function declaration)
  • Loading branch information...
commit ed315823019c8111847fb9a24293dc758ead7c3a 1 parent 0496ad3
@laruence laruence authored
View
2  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).
View
12 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
View
2  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();
View
2  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();
Please sign in to comment.
Something went wrong with that request. Please try again.