summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-06-04 22:09:16 +0000
committerZeev Suraski <zeev@php.net>2000-06-04 22:09:16 +0000
commit1c36e3472f17fe18cd8afe2192cca7ab5d56e02d (patch)
tree81cfc0f90dd1d02254ed337a98dd413bc42fb35c
parent4a1da8b6f9570bca2e97b60755ebe6a6fd8645c7 (diff)
downloadphp-git-1c36e3472f17fe18cd8afe2192cca7ab5d56e02d.tar.gz
Change shutdown order to sort out a crash when assigning a resource id to a static.
-rw-r--r--Zend/zend_compile.c14
-rw-r--r--Zend/zend_execute_API.c22
2 files changed, 21 insertions, 15 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index badb133ad1..c60032c427 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -37,18 +37,6 @@ ZEND_API zend_executor_globals executor_globals;
#define SET_UNUSED(op) (op).op_type = IS_UNUSED
-static int is_not_internal_function(zend_function *function)
-{
- return(function->type != ZEND_INTERNAL_FUNCTION);
-}
-
-
-static int is_not_internal_class(zend_class_entry *ce)
-{
- return(ce->type != ZEND_INTERNAL_CLASS);
-}
-
-
static void free_filename(void *p)
{
efree(*((char **) p));
@@ -124,8 +112,6 @@ void shutdown_compiler(CLS_D)
zend_stack_destroy(&CG(object_stack));
zend_stack_destroy(&CG(declare_stack));
zend_llist_destroy(&CG(filenames_list));
- zend_hash_apply(CG(function_table), (int (*)(void *)) is_not_internal_function);
- zend_hash_apply(CG(class_table), (int (*)(void *)) is_not_internal_class);
zend_llist_destroy(&CG(open_files));
zend_hash_destroy(&CG(used_files));
}
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 9fa150fa5f..8b1cb6f3e0 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -78,6 +78,18 @@ static void zend_extension_deactivator(zend_extension *extension)
}
+static int is_not_internal_function(zend_function *function)
+{
+ return(function->type != ZEND_INTERNAL_FUNCTION);
+}
+
+
+static int is_not_internal_class(zend_class_entry *ce)
+{
+ return(ce->type != ZEND_INTERNAL_CLASS);
+}
+
+
void init_executor(CLS_D ELS_DC)
{
INIT_ZVAL(EG(uninitialized_zval));
@@ -144,13 +156,21 @@ void shutdown_executor(ELS_D)
}
}
- zend_destroy_rsrc_list(ELS_C); /* must be destroyed after the main symbol table is destroyed */
zend_ptr_stack_destroy(&EG(argument_stack));
+
+ /* Destroy all op arrays */
if (EG(main_op_array)) {
destroy_op_array(EG(main_op_array));
efree(EG(main_op_array));
}
+ zend_hash_apply(EG(function_table), (int (*)(void *)) is_not_internal_function);
+ zend_hash_apply(EG(class_table), (int (*)(void *)) is_not_internal_class);
+
+ zend_destroy_rsrc_list(ELS_C); /* must be destroyed after the main symbol table and
+ * op arrays are destroyed.
+ */
+
clean_non_persistent_constants();
#if ZEND_DEBUG
signal(SIGSEGV, original_sigsegv_handler);