1
0
Fork 0

fix type of op_type mismsatch for PHP 5-, assert before changing opline_num

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@769 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 2011-04-18 07:45:56 +00:00
parent 1ef6c24da0
commit 13e183586f
2 changed files with 5 additions and 3 deletions

View File

@ -149,8 +149,8 @@ int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC) /* {{{ */
case ZEND_GOTO:
#endif
case ZEND_JMP:
assert(Z_OP(opline->op1).jmp_addr - op_array->opcodes < op_array->last);
Z_OP(opline->op1).opline_num = Z_OP(opline->op1).jmp_addr - op_array->opcodes;
assert(Z_OP(opline->op1).opline_num < op_array->last);
break;
case ZEND_JMPZ:
case ZEND_JMPNZ:
@ -159,8 +159,8 @@ int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC) /* {{{ */
#ifdef ZEND_JMP_SET
case ZEND_JMP_SET:
#endif
assert(Z_OP(opline->op2).jmp_addr - op_array->opcodes < op_array->last);
Z_OP(opline->op2).opline_num = Z_OP(opline->op2).jmp_addr - op_array->opcodes;
assert(Z_OP(opline->op2).opline_num < op_array->last);
break;
}
#endif
@ -233,7 +233,7 @@ int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC) /* {{{ */
/* }}} */
#ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, zend_uchar *op_type, znode_op *op, int type TSRMLS_DC) /* {{{ */
static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, Z_OP_TYPEOF_TYPE *op_type, znode_op *op, int type TSRMLS_DC) /* {{{ */
{
#ifdef ZEND_ENGINE_2
if ((*op_type != IS_UNUSED && (spec == OPSPEC_UCLASS || spec == OPSPEC_CLASS)) ||

View File

@ -96,12 +96,14 @@ static inline void my_add_assoc_null_ex(zval *arg, char *key, uint key_len)
# define Z_OP(op) (op)
# define Z_OP_CONSTANT(op) (op).literal->constant
# define Z_OP_TYPE(op) op##_##type
# define Z_OP_TYPEOF_TYPE zend_uchar
# define Z_CLASS_INFO(className) (className).info.user
#else
# define Z_OP(op) (op).u
# define Z_OP_CONSTANT(op) (op).u.constant
# define Z_OP_TYPE(op) (op).op_type
# define Z_OP_TYPEOF_TYPE int
typedef znode znode_op;
# define Z_CLASS_INFO(className) (className)