]> granicus.if.org Git - php/commitdiff
- Fixed bug #55007 (compiler fail after previous fail)
authorFelipe Pena <felipe@php.net>
Tue, 7 Jun 2011 22:58:38 +0000 (22:58 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 7 Jun 2011 22:58:38 +0000 (22:58 +0000)
NEWS
Zend/tests/bug55007.phpt [new file with mode: 0644]
Zend/zend.c

diff --git a/NEWS b/NEWS
index c7d8e522de7cbd18f23e3a771ae305b5b19a82ee..0c721342c55320cebef1df8684b9da0080a131df 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PHP                                                                        NEWS
 - Increased the backtrack limit from 100000 to 1000000 (Rasmus)
 
 - Zend Engine:
+  . Fixed bug #55007 (compiler fail after previous fail). (Felipe)
   . Fixed bug #54910 (Crash when calling call_user_func with unknown function
     name). (Dmitry)
   . Fixed bug #54804 (__halt_compiler and imported namespaces).
diff --git a/Zend/tests/bug55007.phpt b/Zend/tests/bug55007.phpt
new file mode 100644 (file)
index 0000000..12fbf12
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+Bug #55007 (compiler fail after previous fail)
+--FILE--
+<?php
+
+function __autoload($classname) {
+  if ('CompileErrorClass'==$classname) eval('class CompileErrorClass { function foo() { $a[] } }');
+  if ('MyErrorHandler'==$classname) eval('class MyErrorHandler { function __construct() { print "My error handler runs.\n"; } }');
+}
+
+function shutdown() {
+  new MyErrorHandler();
+}
+
+
+register_shutdown_function('shutdown');
+       
+new CompileErrorClass();
+
+?>
+--EXPECTF--
+Fatal error: Cannot use [] for reading in %s(%d) : eval()'d code on line %d
+My error handler runs.
index fac824074db30bd87e78bccf9f526ec35eee6667..6861f618bc5a2fbb012394602ebbc5fef2f5af06 100644 (file)
@@ -808,6 +808,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
                exit(-1);
        }
        CG(unclean_shutdown) = 1;
+       CG(active_class_entry) = NULL;
        CG(in_compilation) = EG(in_execution) = 0;
        EG(current_execute_data) = NULL;
        LONGJMP(*EG(bailout), FAILURE);