summaryrefslogtreecommitdiff
path: root/processor
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-02-26 04:04:47 +0000
committerXuefer <xuefer@gmail.com>2014-02-26 04:04:47 +0000
commitd1d5b5f70d6008cb5732738a9353e5679ff226e3 (patch)
tree7e8e6fa028c4abc9ff6d30836dba7254eb10adb2 /processor
parent7b4722df0fad260ff6a66b229cf4276ccd3a5e3e (diff)
downloadxcache-d1d5b5f70d6008cb5732738a9353e5679ff226e3.tar.gz
xcache-d1d5b5f70d6008cb5732738a9353e5679ff226e3.zip
more asserts for class index
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1481 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'processor')
-rw-r--r--processor/head.m42
-rw-r--r--processor/processor.m42
2 files changed, 3 insertions, 1 deletions
diff --git a/processor/head.m4 b/processor/head.m4
index 5bd88cf..868b7a9 100644
--- a/processor/head.m4
+++ b/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);
}
diff --git a/processor/processor.m4 b/processor/processor.m4
index 3f3e43b..aaae239 100644
--- a/processor/processor.m4
+++ b/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(`