Changeset 825 in svn


Ignore:
Timestamp:
2012-03-22T19:18:05+01:00 (3 years ago)
Author:
Xuefer
Message:

PHP_5_4: improve handling traits yet still need review. values of default_properties_table is nullable

Location:
trunk/processor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r779 r825  
    2929define(`SIZEOF_zval_ptr', `sizeof(zval_ptr)')
    3030define(`COUNTOF_zval_ptr', `1')
     31define(`SIZEOF_zval_ptr_nullable', `sizeof(zval_ptr_nullable)')
     32define(`COUNTOF_zval_ptr_nullable', `1')
    3133define(`SIZEOF_xc_entry_name_t', `sizeof(xc_entry_name_t)')
    3234define(`COUNTOF_xc_entry_name_t', `1')
     
    4951
    5052typedef zval *zval_ptr;
     53typedef zval *zval_ptr_nullable;
    5154typedef zend_uchar zval_data_type;
    5255#ifdef IS_UNICODE
  • trunk/processor/processor.m4

    r822 r825  
    33DECL_STRUCT_P_FUNC(`zval')
    44DECL_STRUCT_P_FUNC(`zval_ptr')
     5DECL_STRUCT_P_FUNC(`zval_ptr_nullable')
    56DECL_STRUCT_P_FUNC(`zend_op_array')
    67DECL_STRUCT_P_FUNC(`zend_class_entry')
     
    6566dnl }}}
    6667DEF_HASH_TABLE_FUNC(`HashTable_zval_ptr',           `zval_ptr')
     68DEF_HASH_TABLE_FUNC(`HashTable_zval_ptr_nullable',  `zval_ptr_nullable')
    6769DEF_HASH_TABLE_FUNC(`HashTable_zend_function',      `zend_function')
    6870#ifdef ZEND_ENGINE_2
     
    215217')
    216218dnl }}}
     219DEF_STRUCT_P_FUNC(`zval_ptr_nullable', , `dnl {{{
     220    if (src[0]) {
     221        STRUCT_P_EX(zval_ptr, dst, src, `', `', ` ')
     222    }
     223    else {
     224        IFCOPY(`COPYNULL_EX(src[0], src)')
     225    }
     226    DONE_SIZE(sizeof(zval_ptr_nullable))
     227')
     228dnl }}}
    217229dnl {{{ zend_arg_info
    218230#ifdef ZEND_ENGINE_2
     
    328340#ifdef ZEND_ENGINE_2_4
    329341    DISPATCH(int, default_properties_count)
    330     STRUCT_ARRAY(default_properties_count, zval_ptr, default_properties_table)
     342    STRUCT_ARRAY(default_properties_count, zval_ptr_nullable, default_properties_table)
    331343    DISPATCH(int, default_static_members_count)
    332     STRUCT_ARRAY(default_static_members_count, zval_ptr, default_static_members_table)
     344    STRUCT_ARRAY(default_static_members_count, zval_ptr_nullable, default_static_members_table)
    333345    IFCOPY(`dst->static_members_table = dst->default_static_members_table;')
    334346    DONE(static_members_table)
     
    355367            CALLOC(dst->interfaces, zend_class_entry*, src->num_interfaces)
    356368            DONE(`interfaces')
     369        }
     370        else {
     371            COPYNULL(`interfaces')
     372        }
    357373#   ifdef ZEND_ENGINE_2_4
     374        if (src->num_traits) {
    358375            CALLOC(dst->traits, zend_class_entry*, src->num_traits)
    359376            DONE(`traits')
    360377            DONE(`trait_aliases')
    361378            DONE(`trait_precedences')
    362 #   endif
    363379        }
    364380        else {
    365             COPYNULL(`interfaces')
    366 #   ifdef ZEND_ENGINE_2_4
    367381            COPYNULL(`traits')
    368382            COPYNULL(`trait_aliases')
    369383            COPYNULL(`trait_precedences')
     384        }
    370385#   endif
    371         }
    372386    ')
    373387    IFDASM(`
     
    386400            */
    387401            DONE(`interfaces')
     402        }
     403        else {
     404            COPYNULL(`interfaces')
     405        }
    388406#   ifdef ZEND_ENGINE_2_4
     407        if (src->num_traits) {
    389408            DONE(`traits')
    390409            DONE(`trait_aliases')
    391410            DONE(`trait_precedences')
    392 #   endif
    393411        }
    394412        else {
    395             COPYNULL(`interfaces')
    396 #   ifdef ZEND_ENGINE_2_4
    397413            COPYNULL(`traits')
    398414            COPYNULL(`trait_aliases')
    399415            COPYNULL(`trait_precedences')
     416        }
    400417#   endif
    401         }
    402418    ')
    403419    IFRESTORE(`', `
Note: See TracChangeset for help on using the changeset viewer.