Changeset 345 in svn for trunk/utils.c


Ignore:
Timestamp:
2007-02-04T08:15:00Z (9 years ago)
Author:
Xuefer
Message:

copy function/class table correctly by using add_ref

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils.c

    r344 r345  
    530530/* }}} */
    531531#endif
     532
     533void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce))
     534{
     535#ifdef ZEND_ENGINE_2
     536    (*ce)->refcount++;
     537#else
     538    (*ce->refcount)++;
     539#endif
     540}
     541
    532542xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */
    533543{
     
    572582    h = OG(function_table);
    573583    zend_hash_init_ex(&TG(function_table), 128, NULL, h->pDestructor, h->persistent, h->bApplyProtection);
    574     zend_hash_copy(&TG(function_table), &XG(internal_function_table), NULL, (void *) &tmp_func, sizeof(tmp_func));
     584    zend_hash_copy(&TG(function_table), &XG(internal_function_table), (copy_ctor_func_t) function_add_ref, (void *) &tmp_func, sizeof(tmp_func));
    575585    TG(internal_class_tail) = TG(function_table).pListTail;
    576586
    577587    h = OG(class_table);
    578588    zend_hash_init_ex(&TG(class_table),     16, NULL, h->pDestructor, h->persistent, h->bApplyProtection);
    579     zend_hash_copy(&TG(class_table), &XG(internal_class_table), NULL, (void *) &tmp_cest, sizeof(tmp_cest));
     589    zend_hash_copy(&TG(class_table), &XG(internal_class_table), (copy_ctor_func_t) xc_zend_class_add_ref, (void *) &tmp_cest, sizeof(tmp_cest));
    580590    TG(internal_class_tail) = TG(class_table).pListTail;
    581591
Note: See TracChangeset for help on using the changeset viewer.