mirror of
https://github.com/php/php-src.git
synced 2025-01-19 02:03:47 +08:00
- Fixed various inheritance problems & Andrey's leak
This commit is contained in:
parent
a7af382874
commit
741ca16711
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user