summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-02-03 09:31:59 +0000
committerDmitry Stogov <dmitry@php.net>2006-02-03 09:31:59 +0000
commitb179e081ab28aa494548ea6bea290f53cb79ca62 (patch)
tree82ddc4595794722ff6b433334e8983c70cc9e3ea
parenta31f337c24be7529f4994f2824b6b8cb227f1ed8 (diff)
downloadphp-git-b179e081ab28aa494548ea6bea290f53cb79ca62.tar.gz
Fixed bug #36268 (Object destructors called even after fatal errors)
-rw-r--r--NEWS1
-rwxr-xr-xZend/tests/bug36268.phpt14
-rw-r--r--main/main.c1
3 files changed, 16 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 2a6f4b1751..0707bcd48e 100644
--- 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
index 0000000000..5276d50d48
--- /dev/null
+++ b/Zend/tests/bug36268.phpt
@@ -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
diff --git a/main/main.c b/main/main.c
index 21c81e93b7..3c6d469742 100644
--- a/main/main.c
+++ b/main/main.c
@@ -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;
}