Changeset 411 for eaccelerator/trunk
- Timestamp:
- 02/25/10 11:54:31 (5 months ago)
- Files:
-
- eaccelerator/trunk/ChangeLog (modified) (1 diff)
- eaccelerator/trunk/ea_store.c (modified) (3 diffs)
- eaccelerator/trunk/opcodes.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/ChangeLog
r409 r411 1 2010-02-25 Hans Rakers <hans at react.nl> 2 3 * Fixed class static variable restore where parent was protected 4 static and child was public static. This would lead to error 5 'Access to undeclared static property' upon restore from cache 6 * Added proper handling of class properties during storing in 7 cache. Public/private/protected is properly handled now. Somehow 8 this was a long overdue TODO spotted by running the testsuite. 9 This fixes ticket #408 10 * Small fix that solves some issues with lambda (closure) 11 functions. This solves ticket #405 12 1 13 2010-02-24 Hans Rakers <hans at react.nl> 2 14 eaccelerator/trunk/ea_store.c
r375 r411 672 672 * 673 673 * Most of the logic behind all this can be found in zend_compile.c, functions zend_do_inheritance and 674 * zend_do_inherit_property_access_check674 * do_inherit_property_access_check 675 675 */ 676 676 static int store_property_access_check(Bucket * p, zend_class_entry * from_ce) … … 678 678 zend_class_entry *from = from_ce; 679 679 zend_class_entry *parent = from->parent; 680 681 if (parent) { 682 // hra: TODO - do some usefull stuff :) 683 // check for ACC_PRIVATE etc. 684 // for now, just return keep 680 zend_property_info* child_info = (zend_property_info*)p->pData; 681 zend_property_info* parent_info = NULL; 682 683 return (child_info->ce != from); 684 685 if (parent && zend_hash_quick_find(&parent->properties_info, p->arKey, p->nKeyLength, p->h, (void **) &parent_info)==SUCCESS) { 686 if(parent_info->flags & ZEND_ACC_PRIVATE) { 687 return ZEND_HASH_APPLY_KEEP; 688 } 689 /* if public/private/protected mask differs: copy, else let zend_do_inheritance handle this */ 690 if((parent_info->flags & ZEND_ACC_PPP_MASK) != (child_info->flags & ZEND_ACC_PPP_MASK)) { 691 return ZEND_HASH_APPLY_KEEP; 692 } 693 return ZEND_HASH_APPLY_REMOVE; 685 694 } 686 695 return ZEND_HASH_APPLY_KEEP; … … 714 723 if((zend_hash_find(&parent->properties_info, mname, strlen(mname)+1, &pinfo.ptr) == SUCCESS) && 715 724 (zend_hash_find(&from->properties_info, mname, strlen(mname)+1, &cinfo.ptr) == SUCCESS)) { 716 /* don't copy this static property if protected in parent and static public in child.717 inheritance will handle this properly on restore */718 if(cinfo.v->flags & ZEND_ACC_STATIC && (pinfo.v->flags & ZEND_ACC_PROTECTED && cinfo.v->flags & ZEND_ACC_PUBLIC)) {719 return ZEND_HASH_APPLY_REMOVE;720 }721 725 /* If the static member points to the same value in parent and child, remove for proper inheritance during restore */ 722 726 if(zend_hash_quick_find(&parent->default_static_members, p->arKey, p->nKeyLength, p->h, &pprop.ptr) == SUCCESS) { eaccelerator/trunk/opcodes.c
r377 r411 220 220 OPDEF("UNDEF-151", EXT_UNUSED | OP1_UNUSED | OP2_UNUSED | RES_UNUSED), /* 151 */ 221 221 OPDEF("JMP_SET", EXT_UNUSED | OP1_STD | OP2_JMPADDR| RES_TMP), /* 152 */ 222 OPDEF("DECLARE_LAMBDA_FUNCTION", EXT_UNUSED | OP1_STD | OP2_STD | RES_ UNUSED)/* 153 */222 OPDEF("DECLARE_LAMBDA_FUNCTION", EXT_UNUSED | OP1_STD | OP2_STD | RES_TMP) /* 153 */ 223 223 # endif 224 224 };