summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>1999-07-28 17:59:55 +0000
committerAndi Gutmans <andi@php.net>1999-07-28 17:59:55 +0000
commit741ca1671164f51d330f3518ea14591ba8feff8d (patch)
tree52306459c2ad9f8cf28b5cc8547cc36b8812104e /Zend
parenta7af382874a2b4fcb7dabf01b400bd06a162fc74 (diff)
downloadphp-git-741ca1671164f51d330f3518ea14591ba8feff8d.tar.gz
- Fixed various inheritance problems & Andrey's leak
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_compile.c2
-rw-r--r--Zend/zend_execute.c2
-rw-r--r--Zend/zend_execute_API.c9
-rw-r--r--Zend/zend_globals.h3
-rw-r--r--Zend/zend_hash.c3
5 files changed, 14 insertions, 5 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index ee02ca0019..d7fcc0002d 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1299,6 +1299,8 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
/* copy default properties */
zend_hash_copy(&CG(class_entry).default_properties, &parent_class->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *));
+ CG(class_entry).parent = parent_class;
+
zval_dtor(&parent_class_name->u.constant);
} else {
runtime_inheritence = 1;
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 2b5be29159..e0bc6c8936 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1450,6 +1450,7 @@ do_fcall_common:
EG(opline_ptr) = &opline;
EG(active_op_array) = op_array;
EG(return_value)=original_return_value;
+ EG(destroying_function_symbol_table) = 1;
if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) {
zend_hash_destroy(function_state.function_symbol_table);
efree(function_state.function_symbol_table);
@@ -1457,6 +1458,7 @@ do_fcall_common:
*(++EG(symtable_cache_ptr)) = function_state.function_symbol_table;
zend_hash_clean(*EG(symtable_cache_ptr));
}
+ EG(destroying_function_symbol_table) = 0;
EG(active_symbol_table) = calling_symbol_table;
} else { /* ZEND_OVERLOADED_FUNCTION */
call_overloaded_function(opline->extended_value, &Ts[opline->result.u.var].tmp_var, &EG(regular_list), &EG(persistent_list) ELS_CC);
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index a5b94889c9..586249a345 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -91,6 +91,7 @@ void init_executor(CLS_D ELS_DC)
EG(error_zval).EA.is_ref=0;
EG(error_zval).EA.locks = 0;
EG(error_zval_ptr)=&EG(error_zval);
+ EG(destroying_function_symbol_table) = 0;
zend_ptr_stack_init(&EG(arg_types_stack));
zend_stack_init(&EG(overloaded_objects_stack));
/* destroys stack frame, therefore makes core dumps worthless */
@@ -215,7 +216,13 @@ ZEND_API int zval_ptr_dtor(zval **zval_ptr)
safe_free_zval_ptr(*zval_ptr);
}
if (locked) {
- return 0; /* don't kill the container bucket */
+ ELS_FETCH();
+
+ if (EG(destroying_function_symbol_table)) {
+ return 1;
+ } else {
+ return 0; /* don't kill the container bucket */
+ }
} else {
return 1;
}
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index d922ac7f72..aae7624c7a 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -199,9 +199,10 @@ struct _zend_executor_globals {
HashTable *zend_constants; /* constants table */
long precision;
+ zend_bool destroying_function_symbol_table;
/* for extended information support */
- unsigned char no_extensions;
+ zend_bool no_extensions;
HashTable regular_list;
HashTable persistent_list;
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index f9322cc3f8..c489591f60 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -744,9 +744,6 @@ ZEND_API void zend_hash_destroy(HashTable *ht)
}
if (delete_bucket) {
pefree(q,ht->persistent);
- } else {
- int i;
- i=2;
}
}
pefree(ht->arBuckets,ht->persistent);