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

index 1ff693184cd1d89f92e1c9a154e76b97283332f5..8bd09c67790fb32c9aef6126d03d2c3bc5c2dc86 100644 (file)
@@ -863,6 +863,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 b9282bba5d6f25309a29e8a6ac92c57c0afa43ca..c6b332c5f6171a36b0198fb20ef3d35053379a22 100644 (file)
@@ -202,6 +202,8 @@ void init_executor(TSRMLS_D)
        EG(scope) = NULL;
 
        EG(This) = NULL;
+
+       EG(active) = 1;
 }
 
 static int zval_call_destructor(zval **zv TSRMLS_DC)
@@ -339,6 +341,7 @@ void shutdown_executor(TSRMLS_D)
                        FREE_HASHTABLE(EG(in_autoload));
                }
        } zend_end_try();
+       EG(active) = 0;
 }
 
 
@@ -649,6 +652,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
        int fname_len;
        zstr colon, fname, lcname;
 
+       if (!EG(active)) {
+               return FAILURE; /* executor is already inactive */
+       }
+
        if (EG(exception)) {
                return FAILURE; /* we would result in an instable executor otherwise */
        }
index a7a87634375712b6f550eba95f63a51af284955d..2b8ca89d8ec533375ed1aaeed0b6edb9d9edf16a 100644 (file)
@@ -229,6 +229,8 @@ struct _zend_executor_globals {
 
        zend_property_info std_property_info;
 
+       zend_bool active; 
+
        void *reserved[ZEND_MAX_RESERVED_RESOURCES];
 };