--- /dev/null
+--TEST--
+Bug #43175 (__destruct() throwing an exception with __call() causes segfault)
+--FILE--
+<?php
+
+class foobar {
+ public function __destruct() {
+ throw new Exception();
+ }
+ public function __call($m, $a) {
+ return $this;
+ }
+}
+function foobar() {
+ return new foobar();
+}
+try {
+ foobar()->unknown();
+} catch (Exception $e) {
+ echo "__call via traditional factory should be caught\n";
+}
+?>
+--EXPECT--
+__call via traditional factory should be caught
}
}
+ EX(function_state).function = (zend_function *) EX(op_array);
+ EG(function_state_ptr) = &EX(function_state);
+
if (EG(This)) {
if (EG(exception) && IS_CTOR_CALL(EX(called_scope))) {
if (IS_CTOR_USED(EX(called_scope))) {
EG(called_scope) = current_called_scope;
}
- EX(function_state).function = (zend_function *) EX(op_array);
- EG(function_state_ptr) = &EX(function_state);
zend_ptr_stack_clear_multiple(TSRMLS_C);
if (EG(exception)) {
}
}
+ EX(function_state).function = (zend_function *) EX(op_array);
+ EG(function_state_ptr) = &EX(function_state);
+
if (EG(This)) {
if (EG(exception) && IS_CTOR_CALL(EX(called_scope))) {
if (IS_CTOR_USED(EX(called_scope))) {
EG(called_scope) = current_called_scope;
}
- EX(function_state).function = (zend_function *) EX(op_array);
- EG(function_state_ptr) = &EX(function_state);
zend_ptr_stack_clear_multiple(TSRMLS_C);
if (EG(exception)) {