Changeset 147

Show
Ignore:
Timestamp:
01/16/06 19:03:41 (3 years ago)
Author:
hrak
Message:

Fix for bug #1401474

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/branches/PHP_5_1/ChangeLog

    r146 r147  
     12006-01-16  Hans Rakers <hans at parse dot nl> 
     2 
     3        * PHP_5_1: Fix for bug #1401474 (and most likely some more php-5.1 related trouble) 
     4          static_members handling was incorrect. 
     5 
    162006-01-12  Hans Rakers <hans at parse dot nl> 
    27 
  • eaccelerator/branches/PHP_5_1/ea_restore.c

    r146 r147  
    7474        zend_hash_destroy(&dummy_class_entry.default_properties); 
    7575        zend_hash_destroy(&dummy_class_entry.function_table); 
    76 #ifdef ZEND_ENGINE_2 
    7776        zend_hash_destroy(&dummy_class_entry.constants_table); 
    7877        zend_hash_destroy(&dummy_class_entry.properties_info); 
    79 #endif 
    80 #if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_1) 
     78#  ifdef ZEND_ENGINE_2_1 
     79        zend_hash_destroy(&dummy_class_entry.default_static_members); 
     80#  endif 
     81#  if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_1) 
    8182        zend_hash_destroy(dummy_class_entry.static_members); 
    8283        FREE_HASHTABLE(dummy_class_entry.static_members); 
    83 #endif 
    84 #ifdef ZEND_ENGINE_2_1 
    85         zend_hash_destroy(&dummy_class_entry.default_static_members); 
    86 #endif 
    87  
     84#  endif 
    8885        return property_dtor; 
    8986} 
     
    283280                fixup_zval_hash(from->static_members); 
    284281        } 
     282#  ifdef ZEND_ENGINE_2_1 
     283        fixup_zval_hash(&from->default_static_members); 
     284#  endif 
    285285#else 
    286286        fixup_zval_hash(&from->default_properties); 
     
    711711                to->__unset = to->parent->__unset; 
    712712                to->__isset = to->parent->__isset; 
     713                to->serialize_func = to->parent->serialize_func; 
     714                to->unserialize_func = to->parent->unserialize_func; 
    713715#  endif 
    714716                to->__call = to->parent->__call; 
     
    794796 
    795797        ea_debug_pad(EA_DEBUG TSRMLS_CC); 
    796         ea_debug_printf(EA_DEBUG, "[%d] retore_class_entry: %s\n", getpid(), from->name ? from->name : "(top)"); 
     798        ea_debug_printf(EA_DEBUG, "[%d] restore_class_entry: %s\n", getpid(), from->name ? from->name : "(top)"); 
    797799#ifdef DEBUG 
    798800        EAG(xpad)++; 
    799801#endif 
    800  
    801802        if (to == NULL) { 
    802803                to = emalloc(sizeof(zend_class_entry)); 
     
    812813#ifdef ZEND_ENGINE_2 
    813814        to->ce_flags = from->ce_flags; 
    814         /* 
    815            to->static_members = NULL; 
    816          */ 
    817815        to->num_interfaces = from->num_interfaces; 
    818816        if (to->num_interfaces > 0) { 
     
    825823 
    826824        to->iterator_funcs = from->iterator_funcs; 
     825        to->create_object = from->create_object; 
    827826        to->get_iterator = from->get_iterator; 
    828827        to->interface_gets_implemented = from->interface_gets_implemented; 
     
    873872        to->properties_info.pDestructor = properties_info_dtor; 
    874873 
    875 #ifdef ZEND_ENGINE_2_1 
     874#  ifdef ZEND_ENGINE_2_1 
    876875        /* restore default_static_members */ 
    877876        restore_zval_hash(&to->default_static_members, &from->default_static_members); 
    878877        to->default_static_members.pDestructor = ZVAL_PTR_DTOR; 
    879 #endif 
    880878         
     879        to->static_members = (from->type == ZEND_INTERNAL_CLASS) ? NULL : &to->default_static_members; 
     880#  else 
    881881        if (from->static_members != NULL) { 
    882882                ALLOC_HASHTABLE(to->static_members); 
    883883                restore_zval_hash(to->static_members, from->static_members); 
    884884                to->static_members->pDestructor = ZVAL_PTR_DTOR; 
    885                 /* 
    886                    } else { 
    887                    ALLOC_HASHTABLE(to->static_members); 
    888                    zend_hash_init_ex(to->static_members, 0, NULL, ZVAL_PTR_DTOR, 0, 0); 
    889                  */ 
    890         } 
     885        } 
     886#  endif 
    891887#else 
    892888        to->refcount = emalloc(sizeof(*to->refcount)); 
  • eaccelerator/branches/PHP_5_1/ea_store.c

    r146 r147  
    820820 
    821821#ifdef ZEND_ENGINE_2_1 
    822         store_zval_hash(&to->default_static_members, &from->default_static_members); //LYLE 
    823 #endif 
    824  
     822        store_zval_hash(&to->default_static_members, &from->default_static_members); 
     823#endif 
    825824        store_hash(&to->function_table, &from->function_table, (store_bucket_t) store_op_array); 
    826825 
  • eaccelerator/branches/PHP_5_1/eaccelerator.h

    r146 r147  
    229229        char *name; 
    230230        char *name_lc; 
    231         uint name_length; 
     231        zend_uint name_length; 
    232232        char *parent; 
    233233        HashTable function_table; 
    234234        HashTable default_properties; 
    235 #ifdef ZEND_ENGINE_2_1 
     235#ifdef ZEND_ENGINE_2 
     236        HashTable properties_info; 
     237#  ifdef ZEND_ENGINE_2_1 
    236238        HashTable default_static_members; 
    237 #endif 
    238 #ifdef ZEND_ENGINE_2 
     239#  endif 
     240        HashTable *static_members; 
     241        HashTable constants_table; 
    239242        zend_uint ce_flags; 
    240         HashTable *static_members; 
    241         HashTable properties_info; 
    242         HashTable constants_table; 
    243243        zend_uint num_interfaces; 
    244244 
     
    246246        zend_class_iterator_funcs iterator_funcs; 
    247247 
    248          zend_object_value (*create_object) (zend_class_entry * 
    249                                                                                  class_type TSRMLS_DC); 
    250         zend_object_iterator *(*get_iterator) (zend_class_entry * ce, 
    251                                                                                    zval * object TSRMLS_DC); 
    252         int (*interface_gets_implemented) (zend_class_entry * iface, zend_class_entry * class_type TSRMLS_DC);  /* a class implements this interface */ 
     248        /* handlers */ 
     249        zend_object_value (*create_object) (zend_class_entry *class_type TSRMLS_DC); 
     250        zend_object_iterator *(*get_iterator) (zend_class_entry *ce, zval *object TSRMLS_DC); 
     251        int (*interface_gets_implemented) (zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC);    /* a class implements this interface */ 
     252 
     253        /* hra: serializer callbacks may need to be added here in the future for php 5.1 */ 
    253254 
    254255        char *filename;