Changeset 95

Show
Ignore:
Timestamp:
05/11/05 14:46:01 (4 years ago)
Author:
zoeloelip
Message:

Fix for must constructor related problems with encoded scripts and php5. Also a fixes
memory leak in the loader. (Thanks larnot)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r91 r95  
     12005-05-11 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
     2        * Fix for must constructor related problems with encoded scripts and php5. Also a fixes 
     3          memory leak in the loader. (Thanks larnot) 
     4 
    152005-05-10 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
    26         
  • eaccelerator/trunk/loader.c

    r77 r95  
    943943  to->constants_updated = 0; 
    944944 
    945 #ifdef ZEND_ENGINE_2 /* patch from "Juan M. de la Torre" <juan.torre@iron-gate.net> */ 
     945#ifdef ZEND_ENGINE_2 
    946946  { 
    947947    zend_function *f; 
     
    949949    int fname_len, cname_len; 
    950950    char *fname_lc, *cname_lc; 
    951  
     951    union _zend_function *old_ctor; 
     952 
     953    old_ctor = to->constructor; 
    952954    cname_len = to->name_length; 
    953955    cname_lc  = zend_str_tolower_dup(to->name, cname_len); 
    954  
    955     to->constructor = to->destructor = to->clone = to->__get = to->__set = to->__call = NULL; 
    956956 
    957957    p = to->function_table.pListHead; 
     
    961961      fname_lc  = zend_str_tolower_dup(f->common.function_name, fname_len); 
    962962 
    963       if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len)) 
    964         to->constructor = (zend_function*)f; 
    965       else if (fname_lc[0] == '_' && fname_lc[1] == '_') 
     963      if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len)  
     964                 && to->constructor == old_ctor && f->common.scope != to->parent)   
     965                to->constructor = (zend_function*)f;               
     966          else if (fname_lc[0] == '_' && fname_lc[1] == '_' && f->common.scope != to->parent) 
    966967      { 
    967968        if (fname_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1 && memcmp(fname_lc, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)) == 0)  
     
    981982      p = p->pListNext; 
    982983    } 
     984    efree(cname_lc); 
    983985  } 
    984986#endif