Changeset 89 in svn


Ignore:
Timestamp:
2006-07-16T06:00:42Z (9 years ago)
Author:
Xuefer
Message:

fix #19 prototype inherit from abstract class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/processor.m4

    r78 r89  
    363363    COPY(handle_property_set)
    364364#endif
    365     dnl must after SETNULL(constructor)
     365    dnl must do after SETNULL(constructor) and dst->parent
    366366    STRUCT(HashTable, function_table, HashTable_zend_function)
    367367    IFRESTORE(`dst->function_table.pDestructor = (dtor_func_t) destroy_zend_function;')
     368    IFCOPY(`
     369        processor->active_class_entry_src = NULL;
     370        processor->active_class_entry_dst = NULL;
     371    ')
    368372')
    369373dnl }}}
     
    489493    ')
    490494    DISPATCH(zend_uint, fn_flags)
    491     /* useless */
    492     COPY(prototype)
     495    dnl mark it as -1 on store, and lookup parent on restore
     496    IFSTORE(`dst->prototype = (processor->active_class_entry_src && src->prototype) ? (zend_function *) -1 : NULL; DONE(prototype)', `
     497            IFRESTORE(`do {
     498                zend_function *parent;
     499                if (src->prototype != NULL
     500                 && zend_u_hash_find(&(processor->active_class_entry_dst->parent->function_table),
     501                        UG(unicode) ? IS_UNICODE : IS_STRING,
     502                        src->function_name, strlen(src->function_name) + 1,
     503                        (void **) &parent) == SUCCESS) {
     504                    /* see do_inherit_method_check() */
     505                    if ((parent->common.fn_flags & ZEND_ACC_ABSTRACT)) {
     506                      dst->prototype = parent;
     507                    }
     508                    else {
     509                        dst->prototype = parent->common.prototype;
     510                    }
     511                }
     512                else {
     513                    dst->prototype = NULL;
     514                }
     515                DONE(prototype)
     516            } while (0);
     517            ', `
     518                COPYNULL(prototype)
     519            ')
     520    ')
    493521    STRUCT_ARRAY_I(num_args, zend_arg_info, arg_info)
    494522    DISPATCH(zend_uint, num_args)
Note: See TracChangeset for help on using the changeset viewer.