mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Fixed bug #30162 (Catching exception in constructor couses lose of $this)
This commit is contained in:
parent
95629a63df
commit
37d16df05c
@ -20,7 +20,7 @@ class hariCow extends FIIFO {
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return "Rusticus in asino sedet.";
|
||||
return "ok\n";
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,3 +31,4 @@ $db = new hariCow;
|
||||
echo $db;
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
|
@ -1890,9 +1890,11 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
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));
|
||||
}
|
||||
|
@ -254,9 +254,11 @@ static int zend_do_fcall_common_helper_SPEC(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));
|
||||
}
|
||||
@ -30823,9 +30825,11 @@ static 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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user