Browse Source

more asserts for class index

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1481 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 7 years ago
parent
commit
d1d5b5f70d
  1. 2
      processor/head.m4
  2. 2
      processor/processor.m4

2
processor/head.m4

@ -254,6 +254,7 @@ static zend_ulong xc_get_class_num(xc_processor_t *processor, zend_class_entry *
if (ZCEP_REFCOUNT_PTR(ceptr) == ZCEP_REFCOUNT_PTR(ce)) {
processor->cache_ce = ceptr;
processor->cache_class_index = i;
assert(i <= processor->active_class_index);
return i + 1;
}
}
@ -265,6 +266,7 @@ define(`xc_get_class_num', `IFSTORE(``xc_get_class_num'($@)',``xc_get_class_num'
#ifdef ZEND_ENGINE_2
static zend_class_entry *xc_get_class(xc_processor_t *processor, zend_ulong class_num) { /* {{{ */
/* must be parent or currrent class */
assert(class_num > 0);
assert(class_num <= processor->active_class_index + 1);
return CestToCePtr(processor->php_dst->classinfos[class_num - 1].cest);
}

2
processor/processor.m4

@ -1182,7 +1182,7 @@ DEF_STRUCT_P_FUNC(`xc_entry_data_php_t', , `dnl {{{
STRUCT_ARRAY(zend_uint, funcinfo_cnt, xc_funcinfo_t, funcinfos)
PROCESS(zend_uint, classinfo_cnt)
STRUCT_ARRAY(zend_uint, classinfo_cnt, xc_classinfo_t, classinfos, , IFRESTORE(`processor->active_class_index'))
STRUCT_ARRAY(zend_uint, classinfo_cnt, xc_classinfo_t, classinfos, , IFCOPY(`processor->active_class_index'))
#ifdef ZEND_ENGINE_2_1
PROCESS(zend_uint, autoglobal_cnt)
IFRESTORE(`

Loading…
Cancel
Save