]> granicus.if.org Git - php/commitdiff
MFH: fix #38779 (engine crashes when require()'ing file with syntax error through...
authorAntony Dovgal <tony2001@php.net>
Mon, 11 Sep 2006 14:30:08 +0000 (14:30 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 11 Sep 2006 14:30:08 +0000 (14:30 +0000)
Zend/zend.c
Zend/zend_execute_API.c
Zend/zend_globals.h

index 9b03aa45c8a43f2340f5c77bbfcab3e7ff5bd278..fbef8186c7577e2a78bfaa000d69c3e0a9a53367 100644 (file)
@@ -503,6 +503,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
        EG(current_execute_data) = NULL;
        EG(current_module) = NULL;
        EG(exit_status) = 0;
+       EG(active) = 0;
 }
 
 
index 4170a30e7c1a527602823e19f29aebdb31c92bf1..ab535ea74d0d328bf373d3d5516b98bfd1d522c3 100644 (file)
@@ -188,6 +188,8 @@ void init_executor(TSRMLS_D)
        EG(scope) = NULL;
 
        EG(This) = NULL;
+
+       EG(active) = 1;
 }
 
 static int zval_call_destructor(zval **zv TSRMLS_DC)
@@ -316,6 +318,7 @@ void shutdown_executor(TSRMLS_D)
                        FREE_HASHTABLE(EG(in_autoload));
                }
        } zend_end_try();
+       EG(active) = 0;
 }
 
 
@@ -613,6 +616,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
        char *fname, *colon;
        int fname_len;
 
+       if (!EG(active)) {
+               return FAILURE; /* executor is already inactive */
+       }
+
        if (EG(exception)) {
                return FAILURE; /* we would result in an instable executor otherwise */
        }
index 53c51e9b64df3f3eaee1d92e63dfbaef67ea17b9..4bc92a447791f35104f632c5c2359a4fda6f7093 100644 (file)
@@ -237,6 +237,8 @@ struct _zend_executor_globals {
 
        zend_property_info std_property_info;
 
+       zend_bool active; 
+
        void *reserved[ZEND_MAX_RESERVED_RESOURCES];
 };