]> granicus.if.org Git - php/commitdiff
- Fix #32226
authorMarcus Boerger <helly@php.net>
Mon, 7 Mar 2005 19:28:10 +0000 (19:28 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 7 Mar 2005 19:28:10 +0000 (19:28 +0000)
Zend/tests/bug32226.phpt [new file with mode: 0755]
Zend/zend_builtin_functions.c

diff --git a/Zend/tests/bug32226.phpt b/Zend/tests/bug32226.phpt
new file mode 100755 (executable)
index 0000000..b440bc5
--- /dev/null
@@ -0,0 +1,36 @@
+--TEST--
+Bug # 32226
+--FILE--
+<?
+
+class A
+{
+        public function A()
+        {
+                set_exception_handler(array($this, 'EH'));
+
+                throw new Exception();
+        }
+
+        public function EH()
+        {
+                restore_exception_handler();
+
+                throw new Exception();
+        }
+}
+
+try
+{
+$a = new A();
+}
+catch(Exception $e)
+{
+       echo "Caught\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Caught
+===DONE===
index 482042483a568eceeba76741614862a46ea2fcd4..fa01ba5fc8305fb86b7f6e22cf164ed62c851bed 100644 (file)
@@ -1753,7 +1753,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
                if (function_name) {
                        add_assoc_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
 
-                       if (ptr->object) {
+                       if (ptr->object && Z_TYPE_P(ptr->object) == IS_OBJECT) {
                                class_name = Z_OBJCE(*ptr->object)->name;
                                call_type = "->";
                        } else if (ptr->function_state.function->common.scope) {