summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-05-04 08:41:56 +0000
committerDmitry Stogov <dmitry@php.net>2005-05-04 08:41:56 +0000
commit7f3804f4ae4805965a426a65f1386c61ed04546c (patch)
tree57b6d2e27c37f8ac1c1701a36c34da69121e354c /Zend/zend_execute.c
parent659c0d344a318cb41528f29d443dcf43bbdcc7da (diff)
downloadphp-git-7f3804f4ae4805965a426a65f1386c61ed04546c.tar.gz
Fixed bug #30162 (Catching exception in constructor couses lose of $this)
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index e282f9056f..9bac1bd941 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2815,9 +2815,11 @@ int zend_do_fcall_common_helper(ZEND_OPCODE_HANDLER_ARGS)
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));
}