summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2015-04-18 16:07:05 +0000
committerXuefer <xuefer@gmail.com>2015-04-18 16:07:05 +0000
commit95da04c9f2548f5eae0db1b46347361d09c96724 (patch)
tree0aeb9d4dabc0e647243cf1d63f0fffa8f843b2cc
parentc9aea0c76408fc7b0e022fc5af93d2c72522bc93 (diff)
downloadxcache-95da04c9f2548f5eae0db1b46347361d09c96724.tar.gz
xcache-95da04c9f2548f5eae0db1b46347361d09c96724.zip
dasm: fix include opcode spec
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1592 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
-rw-r--r--processor/processor.m47
-rw-r--r--xcache/xc_utils.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/processor/processor.m4 b/processor/processor.m4
index 955f720..786ddf4 100644
--- a/processor/processor.m4
+++ b/processor/processor.m4
@@ -662,7 +662,12 @@ define(`UNION_znode_op', `dnl {{{
', `
IFDASM(`{
zval *zv;
- zval *srczv = &dasm->active_op_array_src->literals[SRC(`$1.constant')].constant;
+ zval *srczv;
+ if (SRC(`$1.constant') >= dasm->active_op_array_src->last_literal) {
+ fprintf(stderr, "opcode %s $1 want literal %d\n", xc_get_opcode(SRC(`opcode')), SRC(`$1.constant'));
+ break;
+ }
+ srczv = &dasm->active_op_array_src->literals[SRC(`$1.constant')].constant;
ALLOC_ZVAL(zv);
MAKE_COPY_ZVAL(&srczv, zv);
add_assoc_zval_ex(DST(), XCACHE_STRS("$1.constant"), zv);
diff --git a/xcache/xc_utils.c b/xcache/xc_utils.c
index 4c2b576..7bcce1b 100644
--- a/xcache/xc_utils.c
+++ b/xcache/xc_utils.c
@@ -302,7 +302,10 @@ static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, Z_OP_TYPEOF_TYP
}
switch (*op_type) {
case IS_CONST:
- if (spec == OPSPEC_UNUSED || spec == OPSPEC_OPLINE) {
+ if (spec == OPSPEC_UNUSED
+ || spec == OPSPEC_OPLINE
+ || spec == OPSPEC_INCLUDE
+ ) {
*op_type = IS_UNUSED;
}
break;