Show
Ignore:
Timestamp:
04/06/06 18:49:25 (3 years ago)
Author:
hans
Message:

Fixed handling of interfaces. This fixes sf.net bug #1440575

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ea_store.c

    r187 r195  
    837837{ 
    838838        eaccelerator_class_entry *to; 
     839        unsigned int i; 
     840 
    839841        EACCELERATOR_ALIGN(EAG(mem)); 
    840842        to = (eaccelerator_class_entry *) EAG(mem); 
     
    847849        to->ce_flags = from->ce_flags; 
    848850        to->static_members = NULL; 
    849         to->num_interfaces = from->num_interfaces; 
    850         /* hrak: no need to really store the interfaces since these get populated 
    851          * at/after restore by zend_do_inheritance and ZEND_ADD_INTERFACE */ 
    852         to->interfaces = NULL; 
     851 
     852        /* 
     853         * Scan the interfaces looking for the first one which isn't 0 
     854         * This is the first inherited interface and should not be counted in the stored object 
     855         */ 
     856        for (i = 0 ; i < from->num_interfaces ; i++) { 
     857                if (from->interfaces[i] != 0) { 
     858                        break; 
     859                } 
     860        } 
     861        to->num_interfaces = i; 
     862        DBG(ea_debug_printf, (EA_DEBUG, "from->num_interfaces=%d, to->num_interfaces=%d\n", from->num_interfaces, to->num_interfaces)); 
     863 
     864        /* 
     865         * hrak: no need to really store the interfaces since these get populated 
     866         * at/after restore by zend_do_inheritance and ZEND_ADD_INTERFACE 
     867         */ 
    853868#endif 
    854869 
     
    870885        to->line_end = from->line_end; 
    871886        to->doc_comment_len = from->doc_comment_len; 
    872         to->iterator_funcs = from->iterator_funcs; 
    873         to->create_object = from->create_object; 
    874         to->get_iterator = from->get_iterator; 
    875         to->interface_gets_implemented = from->interface_gets_implemented; 
    876887 
    877888        if (from->filename != NULL)