cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests bug30161.phpt
| From: | Dmitry Stogov | Date: | Wed, 04 May 2005 08:45:46 +0000 |
| Subject: | cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests bug30161.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3646@lists.php.net to get a copy of this message | ||
dmitry Wed May 4 04:45:46 2005 EDT
Modified files:
/ZendEngine2 zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h
/ZendEngine2/tests bug30161.phpt
Log:
Fixed bug #30162 (Catching exception in constructor couses lose of $this)
http://cvs.php.net/diff.php/ZendEngine2/zend_vm_def.h?r1=1.23&r2=1.24&ty=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.23 ZendEngine2/zend_vm_def.h:1.24
--- ZendEngine2/zend_vm_def.h:1.23 Wed Apr 27 08:16:31 2005
+++ ZendEngine2/zend_vm_def.h Wed May 4 04:45:45 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_def.h,v 1.23 2005/04/27 12:16:31 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.24 2005/05/04 08:45:45 dmitry Exp $ */
ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
{
@@ -1890,9 +1890,11 @@
if (EG(exception) && EX(fbc) && EX(fbc)->common.fn_flags&ZEND_ACC_CTOR) {
EG(This)->refcount--;
if (EG(This)->refcount == 1) {
- zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
+ zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
+ }
+ if (should_change_scope && EG(This) != current_this) {
+ zval_ptr_dtor(&EG(This));
}
- zval_ptr_dtor(&EG(This));
} else if (should_change_scope) {
zval_ptr_dtor(&EG(This));
}
http://cvs.php.net/diff.php/ZendEngine2/zend_vm_execute.h?r1=1.25&r2=1.26&ty=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.25 ZendEngine2/zend_vm_execute.h:1.26
--- ZendEngine2/zend_vm_execute.h:1.25 Wed Apr 27 08:16:31 2005
+++ ZendEngine2/zend_vm_execute.h Wed May 4 04:45:45 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_execute.h,v 1.25 2005/04/27 12:16:31 dmitry Exp $ */
+/* $Id: zend_vm_execute.h,v 1.26 2005/05/04 08:45:45 dmitry Exp $ */
#define ZEND_VM_CONTINUE() return 0
@@ -254,9 +254,11 @@
if (EG(exception) && EX(fbc) && EX(fbc)->common.fn_flags&ZEND_ACC_CTOR) {
EG(This)->refcount--;
if (EG(This)->refcount == 1) {
- zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
+ zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
+ }
+ if (should_change_scope && EG(This) != current_this) {
+ zval_ptr_dtor(&EG(This));
}
- zval_ptr_dtor(&EG(This));
} else if (should_change_scope) {
zval_ptr_dtor(&EG(This));
}
@@ -30823,9 +30825,11 @@
if (EG(exception) && EX(fbc) && EX(fbc)->common.fn_flags&ZEND_ACC_CTOR) {
EG(This)->refcount--;
if (EG(This)->refcount == 1) {
- zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
+ zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
+ }
+ if (should_change_scope && EG(This) != current_this) {
+ zval_ptr_dtor(&EG(This));
}
- zval_ptr_dtor(&EG(This));
} else if (should_change_scope) {
zval_ptr_dtor(&EG(This));
}
http://cvs.php.net/diff.php/ZendEngine2/zend_vm_opcodes.h?r1=1.12&r2=1.13&ty=u
Index: ZendEngine2/zend_vm_opcodes.h
diff -u ZendEngine2/zend_vm_opcodes.h:1.12 ZendEngine2/zend_vm_opcodes.h:1.13
--- ZendEngine2/zend_vm_opcodes.h:1.12 Wed Apr 27 08:16:32 2005
+++ ZendEngine2/zend_vm_opcodes.h Wed May 4 04:45:45 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_opcodes.h,v 1.12 2005/04/27 12:16:32 dmitry Exp $ */
+/* $Id: zend_vm_opcodes.h,v 1.13 2005/05/04 08:45:45 dmitry Exp $ */
#define ZEND_NOP 0
#define ZEND_ADD 1
http://cvs.php.net/diff.php/ZendEngine2/tests/bug30161.phpt?r1=1.1&r2=1.2&ty=u
Index: ZendEngine2/tests/bug30161.phpt
diff -u ZendEngine2/tests/bug30161.phpt:1.1 ZendEngine2/tests/bug30161.phpt:1.2
--- ZendEngine2/tests/bug30161.phpt:1.1 Sat Apr 23 11:20:09 2005
+++ ZendEngine2/tests/bug30161.phpt Wed May 4 04:45:46 2005
@@ -20,7 +20,7 @@
}
public function __toString() {
- return "Rusticus in asino sedet.";
+ return "ok\n";
}
}
@@ -31,3 +31,4 @@
echo $db;
?>
--EXPECT--
+ok