]> granicus.if.org Git - php/commitdiff
Fixed bug #36268 (Object destructors called even after fatal errors)
authorDmitry Stogov <dmitry@php.net>
Fri, 3 Feb 2006 09:31:59 +0000 (09:31 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 3 Feb 2006 09:31:59 +0000 (09:31 +0000)
NEWS
Zend/tests/bug36268.phpt [new file with mode: 0755]
main/main.c

diff --git a/NEWS b/NEWS
index 2a6f4b17510154842a8098ebd53f47a240d787bc..0707bcd48eb6a4b24a6ec8704893ef5438e177b5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ PHP                                                                        NEWS
 - Added imap_savebody() that allows message body to be written to a file. (Mike)
 - Fixed imagecolorallocate() and imagecolorallocatelapha() to return FALSE
   on error. (Pierre)
+- Fixed bug #36268 (Object destructors called even after fatal errors). (Dmitry)
 - Fixed bug #36258 (SplFileObject::getPath() may lead to segfault). (Tony)
 - Fixed bug #36242 (Possible memory corruption in stream_select()). (Tony)
 - Fixed bug #36235 (ocicolumnname returns false before a succesfull fetch). 
diff --git a/Zend/tests/bug36268.phpt b/Zend/tests/bug36268.phpt
new file mode 100755 (executable)
index 0000000..5276d50
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+Bug #36268 (Object destructors called even after fatal errors)
+--FILE--
+<?php
+class Foo {
+       function __destruct() {
+               echo "Ha!\n";
+       }
+}
+$x = new Foo();
+bar();
+?>
+--EXPECTF--
+Fatal error: Call to undefined function bar() in %sbug36268.php on line 8
index 21c81e93b7f81c02f1339b51a7fdb1fe4550a633..3c6d4697427bd433da17e9ceefc450222f51fb0c 100644 (file)
@@ -820,6 +820,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
                                AG(memory_limit) = PG(memory_limit); 
 #endif
                                efree(buffer);
+                               zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
                                zend_bailout();
                                return;
                        }