Browse files

- Fixed various inheritance problems & Andrey's leak

  • Loading branch information...
1 parent a7af382 commit 741ca1671164f51d330f3518ea14591ba8feff8d @andigutmans andigutmans committed Jul 28, 1999
Showing with 14 additions and 5 deletions.
  1. +2 −0 Zend/zend_compile.c
  2. +2 −0 Zend/zend_execute.c
  3. +8 −1 Zend/zend_execute_API.c
  4. +2 −1 Zend/zend_globals.h
  5. +0 −3 Zend/zend_hash.c
View
2 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;
View
2 Zend/zend_execute.c
@@ -1450,13 +1450,15 @@ binary_assign_op_addr: {
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);
} else {
*(++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);
View
9 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;
}
View
3 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;
View
3 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);

0 comments on commit 741ca16

Please sign in to comment.