For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > July 2006 > cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h
Dmitry Stogov

2006-07-11, 7:56 am

dmitry Tue Jul 11 08:52:44 2006 UTC

Modified files:
/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.121 ZendEngine2/zend_vm_def.h:1.122
--- ZendEngine2/zend_vm_def.h:1.121 Thu Jul 6 15:28:05 2006
+++ ZendEngine2/zend_vm_def.h Tue Jul 11 08:52:44 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_vm_def.h,v 1.121 2006/07/06 15:28:05 pollita Exp $ */
+/* $Id: zend_vm_def.h,v 1.122 2006/07/11 08:52:44 dmitry Exp $ */

/* If you change this file, please regenerate the zend_vm_execute.h and
* zend_vm_opcodes.h files by running:
@@ -3166,6 +3166,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();
}
}
@@ -3173,6 +3178,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...6&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.125 ZendEngine2/zend_vm_execute.h:1.126
--- ZendEngine2/zend_vm_execute.h:1.125 Thu Jul 6 15:28:05 2006
+++ ZendEngine2/zend_vm_execute.h Tue Jul 11 08:52:44 2006
@@ -2130,6 +2130,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();
}
}
@@ -2137,6 +2142,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 */
@@ -4686,6 +4696,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();
}
}
@@ -4693,6 +4708,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 */
@@ -7839,6 +7859,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();
}
}
@@ -7846,6 +7871,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 */
@@ -20588,6 +20618,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();
}
}
@@ -20595,6 +20630,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 */
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com