| Dmitry Stogov 2006-07-11, 7:56 am |
| dmitry Tue Jul 11 08:52:30 2006 UTC
Modified files: (Branch: PHP_5_2)
/ZendEngine2 zend_vm_def.h zend_vm_execute.h
Log:
Fixed memory leak in case of exception in iterator callbacks in 'foreach(new Iterator()...' (spl/tests/iterator_047.phpt).
http://cvs.php.net/viewvc.cgi/ZendE...2&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.59.2.29.2.11 ZendEngine2/zend_vm_def.h:1.59.2.29.2.12
--- ZendEngine2/zend_vm_def.h:1.59.2.29.2.11 Thu Jul 6 15:32:07 2006
+++ ZendEngine2/zend_vm_def.h Tue Jul 11 08:52:28 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_def.h,v 1.59.2.29.2.11 2006/07/06 15:32:07 pollita Exp $ */
+/* $Id: zend_vm_def.h,v 1.59.2.29.2.12 2006/07/11 08:52:28 dmitry Exp $ */
/* If you change this file, please regenerate the zend_vm_execute.h and
* zend_vm_opcodes.h files by running:
@@ -3091,6 +3091,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
+ } else {
+ FREE_OP1_IF_VAR();
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -3098,6 +3103,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
+ } else {
+ FREE_OP1_IF_VAR();
+ }
ZEND_VM_NEXT_OPCODE();
}
iter->index = -1; /* will be set to 0 before using next handler */
http://cvs.php.net/viewvc.cgi/ZendE...2&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.11 ZendEngine2/zend_vm_execute.h:1.62.2.30.2.12
--- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.11 Thu Jul 6 15:32:06 2006
+++ ZendEngine2/zend_vm_execute.h Tue Jul 11 08:52:28 2006
@@ -2163,6 +2163,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -2170,6 +2175,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
iter->index = -1; /* will be set to 0 before using next handler */
@@ -4663,6 +4673,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -4670,6 +4685,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
iter->index = -1; /* will be set to 0 before using next handler */
@@ -7745,6 +7765,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ } else {
+ if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -7752,6 +7777,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ } else {
+ if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ }
ZEND_VM_NEXT_OPCODE();
}
iter->index = -1; /* will be set to 0 before using next handler */
@@ -19983,6 +20013,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -19990,6 +20025,11 @@
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
iter->index = -1; /* will be set to 0 before using next handler */
|