Changeset 344 for trunk/utils.c


Ignore:
Timestamp:
2007-02-04T07:22:14+01:00 (8 years ago)
Author:
moo
Message:

copy internal functions/classes into sandbox, they're needed by compiler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils.c

    r305 r344  
    11 
    22#include "xcache.h" 
     3#include "stack.h" 
     4#include "xcache_globals.h" 
    35#include "utils.h" 
    46#ifdef ZEND_ENGINE_2_1 
     
    531533{ 
    532534    HashTable *h; 
     535    zend_function tmp_func; 
     536    xc_cest_t tmp_cest; 
     537 
    533538    if (sandbox) { 
    534539        memset(sandbox, 0, sizeof(sandbox[0])); 
     
    567572    h = OG(function_table); 
    568573    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)); 
     575    TG(internal_class_tail) = TG(function_table).pListTail; 
     576 
    569577    h = OG(class_table); 
    570578    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)); 
     580    TG(internal_class_tail) = TG(class_table).pListTail; 
     581 
    571582#ifdef ZEND_ENGINE_2_1 
    572583    /* shallow copy, don't destruct */ 
     
    613624#endif 
    614625 
    615     b = TG(function_table).pListHead; 
     626    b = TG(internal_function_tail) ? TG(internal_function_tail)->pListNext : TG(function_table).pListHead; 
    616627    /* install function */ 
    617628    while (b != NULL) { 
     
    622633    } 
    623634 
    624     b = TG(class_table).pListHead; 
     635    b = TG(internal_class_tail) ? TG(internal_class_tail)->pListNext : TG(class_table).pListHead; 
    625636    /* install class */ 
    626637    while (b != NULL) { 
Note: See TracChangeset for help on using the changeset viewer.