Browse Source

processor: remove commented code, fix corruption detected by --eanble-xcache-test for [196]

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@199 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.2
Xuefer 15 years ago
parent
commit
015d71b366
  1. 27
      processor/head.m4
  2. 12
      processor/processor.m4

27
processor/head.m4

@ -248,7 +248,7 @@ dnl FIXME: handle common.function_name here
/* }}} */
static int xc_hash_static_member_check(xc_processor_t *processor, Bucket *b TSRMLS_DC) /* {{{ */
{
zend_class_entry *src = processor->active_class_entry_src;
const zend_class_entry *src = processor->active_class_entry_src;
if (src->parent) {
zval **srczv;
if (zend_hash_quick_find(CE_STATIC_MEMBERS(src), b->arKey, b->nKeyLength, b->h, (void **) &srczv) == SUCCESS) {
@ -264,33 +264,16 @@ static int xc_hash_static_member_check(xc_processor_t *processor, Bucket *b TSRM
/* fix static members on restore */
static void inherit_static_prop(zval **p) /* {{{ */
{
/* already set */
#if 0
(*p)->refcount++;
(*p)->is_ref = 1;
#endif
}
/* }}} */
static void xc_fix_static_members(xc_processor_t *processor, zend_class_entry *dst TSRMLS_DC) /* {{{ */
{
zend_class_entry *parent_ce = dst->parent;
if (parent_ce->type != dst->type) {
/* User class extends internal class */
zend_update_class_constants(parent_ce TSRMLS_CC);
zend_hash_merge(&dst->default_static_members, CE_STATIC_MEMBERS(parent_ce), (void (*)(void *)) inherit_static_prop, NULL, sizeof(zval *), 0);
}
else {
zend_hash_merge(&dst->default_static_members, &parent_ce->default_static_members, (void (*)(void *)) inherit_static_prop, NULL, sizeof(zval *), 0);
}
/*
HashPosition pos;
HashTable *pmembers = CE_STATIC_MEMBERS(dst->parent);
zval **zv;
for (zend_hash_internal_pointer_reset_ex(pmembers, &pos);
zend_hash_get_current_data_ex(pmembers, (void **) &zv, &pos) == SUCCESS;
zend_hash_move_forward_ex(pmembers, &pos)) {
if (zend_hash_quick_find(parent->static_members, p->arKey, p->nKeyLength, p->h, &pprop.ptr) == SUCCESS) {
}
}
*/
zend_hash_merge(&dst->default_static_members, &dst->parent->default_static_members, (void (*)(void *)) inherit_static_prop, NULL, sizeof(zval *), 0);
}
/* }}} */
#endif

12
processor/processor.m4

@ -264,9 +264,9 @@ DEF_STRUCT_P_FUNC(`zend_property_info', , `
#endif
dnl }}}
DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
IFCOPY(`
IFCALCCOPY(`
processor->active_class_entry_src = src;
processor->active_class_entry_dst = dst;
IFCOPY(`processor->active_class_entry_dst = dst;')
')
DISPATCH(char, type)
DISPATCH(zend_uint, name_length)
@ -297,12 +297,12 @@ DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
#ifdef ZEND_ENGINE_2
STRUCT(HashTable, properties_info, HashTable_zend_property_info)
# ifdef ZEND_ENGINE_2_1
STRUCT(HashTable, default_static_members, IFSTORE(HashTable_zval_ptr_static_member_check, HashTable_zval_ptr))
STRUCT(HashTable, default_static_members, IFCALCSTORE(HashTable_zval_ptr_static_member_check, HashTable_zval_ptr))
IFCOPY(`dst->static_members = &dst->default_static_members;')
IFRESTORE(`if (dst->parent) xc_fix_static_members(processor, dst TSRMLS_CC);')
DONE(static_members)
# else
STRUCT_P(HashTable, static_members, IFSTORE(HashTable_zval_ptr_static_member_check, HashTable_zval_ptr))
STRUCT_P(HashTable, static_members, IFCALCSTORE(HashTable_zval_ptr_static_member_check, HashTable_zval_ptr))
# endif
STRUCT(HashTable, constants_table, HashTable_zval_ptr)
@ -383,9 +383,9 @@ DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
dnl must do after SETNULL(constructor) and dst->parent
STRUCT(HashTable, function_table, HashTable_zend_function)
IFRESTORE(`dst->function_table.pDestructor = ZEND_FUNCTION_DTOR;')
IFCOPY(`
IFCALCCOPY(`
processor->active_class_entry_src = NULL;
processor->active_class_entry_dst = NULL;
IFCOPY(`processor->active_class_entry_dst = NULL;')
')
')
dnl }}}

Loading…
Cancel
Save