cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests bug32993.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Mon, 06 Jun 2005 08:24:06 +0000 |
| Subject: | cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests bug32993.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3714@lists.php.net to get a copy of this message | ||
dmitry Mon Jun 6 04:24:06 2005 EDT
Added files:
/ZendEngine2/tests bug32993.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h
Log:
Fixed bug #32993 (implemented Iterator function current() don't throw exception)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1905&r2=1.1906&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1905 php-src/NEWS:1.1906
--- php-src/NEWS:1.1905 Fri Jun 3 04:48:58 2005
+++ php-src/NEWS Mon Jun 6 04:24:01 2005
@@ -120,6 +120,8 @@
- Fixed bug with $HTTP_RAW_POST_DATA not getting set. (Brian)
- Fixed bug in mysql::client_version(). (Georg)
- Fixed ZTS destruction. (Marcus)
+- Fixed bug #32993 (implemented Iterator function current() don't throw
+ exception). (Dmitry)
- Fixed bug #32924 (file included with "auto_prepend_file" can be included
with require_once() or include_once()). (Stas)
- Fixed bug #32833 (Invalid opcode). (Dmitry)
http://cvs.php.net/diff.php/ZendEngine2/zend_vm_def.h?r1=1.28&r2=1.29&ty=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.28 ZendEngine2/zend_vm_def.h:1.29
--- ZendEngine2/zend_vm_def.h:1.28 Fri Jun 3 07:16:17 2005
+++ ZendEngine2/zend_vm_def.h Mon Jun 6 04:24:03 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_def.h,v 1.28 2005/06/03 11:16:17 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.29 2005/06/06 08:24:03 dmitry Exp $ */
ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
{
@@ -3110,13 +3110,13 @@
ZEND_VM_CONTINUE_JMP();
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
+ if (EG(exception)) {
+ array->refcount--;
+ zval_ptr_dtor(&array);
+ ZEND_VM_NEXT_OPCODE();
+ }
if (!value) {
/* failure in get_current_data */
- if (EG(exception)) {
- array->refcount--;
- zval_ptr_dtor(&array);
- ZEND_VM_NEXT_OPCODE();
- }
ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num);
ZEND_VM_CONTINUE_JMP();
}
http://cvs.php.net/diff.php/ZendEngine2/zend_vm_execute.h?r1=1.30&r2=1.31&ty=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.30 ZendEngine2/zend_vm_execute.h:1.31
--- ZendEngine2/zend_vm_execute.h:1.30 Fri Jun 3 07:16:17 2005
+++ ZendEngine2/zend_vm_execute.h Mon Jun 6 04:24:03 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_execute.h,v 1.30 2005/06/03 11:16:17 dmitry Exp $ */
+/* $Id: zend_vm_execute.h,v 1.31 2005/06/06 08:24:03 dmitry Exp $ */
#define ZEND_VM_CONTINUE() return 0
@@ -7667,13 +7667,13 @@
ZEND_VM_CONTINUE_JMP();
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
+ if (EG(exception)) {
+ array->refcount--;
+ zval_ptr_dtor(&array);
+ ZEND_VM_NEXT_OPCODE();
+ }
if (!value) {
/* failure in get_current_data */
- if (EG(exception)) {
- array->refcount--;
- zval_ptr_dtor(&array);
- ZEND_VM_NEXT_OPCODE();
- }
ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num);
ZEND_VM_CONTINUE_JMP();
}
@@ -32793,13 +32793,13 @@
ZEND_VM_CONTINUE_JMP();
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
+ if (EG(exception)) {
+ array->refcount--;
+ zval_ptr_dtor(&array);
+ ZEND_VM_NEXT_OPCODE();
+ }
if (!value) {
/* failure in get_current_data */
- if (EG(exception)) {
- array->refcount--;
- zval_ptr_dtor(&array);
- ZEND_VM_NEXT_OPCODE();
- }
ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num);
ZEND_VM_CONTINUE_JMP();
}
http://cvs.php.net/diff.php/ZendEngine2/zend_vm_opcodes.h?r1=1.17&r2=1.18&ty=u
Index: ZendEngine2/zend_vm_opcodes.h
diff -u ZendEngine2/zend_vm_opcodes.h:1.17 ZendEngine2/zend_vm_opcodes.h:1.18
--- ZendEngine2/zend_vm_opcodes.h:1.17 Fri Jun 3 07:16:19 2005
+++ ZendEngine2/zend_vm_opcodes.h Mon Jun 6 04:24:05 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_opcodes.h,v 1.17 2005/06/03 11:16:19 dmitry Exp $ */
+/* $Id: zend_vm_opcodes.h,v 1.18 2005/06/06 08:24:05 dmitry Exp $ */
#define ZEND_NOP 0
#define ZEND_ADD 1
http://cvs.php.net/co.php/ZendEngine2/tests/bug32993.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug32993.phpt
+++ ZendEngine2/tests/bug32993.phpt
--TEST--
Bug #32993 (implemented Iterator function current() don't throw exception)
--FILE--
<?php
class Test implements Iterator {
public $arr = array();
public function rewind() { return reset($this->arr); }
public function current() { throw new Exception(); }
public function key() { return key($this->arr); }
public function next() { return next($this->arr); }
public function valid() { return (current($this->arr) !== false); }
}
$t = new Test();
$t->arr = array(1, 2, 3);
try {
foreach ($t as $v) {
echo "$v\n";
}
} catch (Exception $e) {
; // handle exception
}
echo "ok\n";
?>
--EXPECT--
ok