Changeset 588 for trunk/utils.c


Ignore:
Timestamp:
2009-04-01T10:06:38+02:00 (5 years ago)
Author:
moo
Message:

handle compile time new constant. fixed #208: null as default value for parameters with array type hint produces a fatal error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils.c

    r555 r588  
    595595#endif 
    596596 
     597static void xc_copy_zend_constant(zend_constant *c) /* {{{ */ 
     598{ 
     599    c->name = zend_strndup(c->name, c->name_len - 1); 
     600    if (!(c->flags & CONST_PERSISTENT)) { 
     601        zval_copy_ctor(&c->value); 
     602    } 
     603} 
     604/* }}} */ 
    597605xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */ 
    598606{ 
     
    632640    h = OG(zend_constants); 
    633641    zend_hash_init_ex(&TG(zend_constants),  20, NULL, h->pDestructor, h->persistent, h->bApplyProtection); 
     642    { 
     643        zend_constant tmp_const; 
     644        zend_hash_copy(&TG(zend_constants), &XG(internal_constant_table), (copy_ctor_func_t) xc_copy_zend_constant, (void *) &tmp_const, sizeof(tmp_const)); 
     645    } 
    634646#endif 
    635647    h = OG(function_table); 
     
    679691    /* Using ZEND_COMPILE_IGNORE_INTERNAL_CLASSES for ZEND_FETCH_CLASS_RT_NS_CHECK 
    680692     */ 
    681     CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_DELAYED_BINDING; 
     693    CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_DELAYED_BINDING; 
    682694#endif 
    683695 
     
    698710 
    699711#ifdef HAVE_XCACHE_CONSTANT 
    700     b = TG(zend_constants).pListHead; 
     712    b = /*TG(internal_constant_tail) ? TG(internal_constant_tail)->pListNext :*/ TG(zend_constants).pListHead; 
    701713    /* install constants */ 
    702714    while (b != NULL) { 
Note: See TracChangeset for help on using the changeset viewer.