summaryrefslogtreecommitdiff
path: root/xcache
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2013-09-22 16:17:46 +0000
committerXuefer <xuefer@gmail.com>2013-09-22 16:17:46 +0000
commite715a9197818cad6d6fc679263751e0cf759967b (patch)
tree44cf5c8b19b07332959430c7a9729153634b6c33 /xcache
parentf46ace6822589c8e68120ccddc8d9ccfec5a92c6 (diff)
downloadxcache-e715a9197818cad6d6fc679263751e0cf759967b.tar.gz
xcache-e715a9197818cad6d6fc679263751e0cf759967b.zip
readonly protection for copied array
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1385 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'xcache')
-rw-r--r--xcache/xc_allocator_bestfit.c3
-rw-r--r--xcache/xc_utils.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/xcache/xc_allocator_bestfit.c b/xcache/xc_allocator_bestfit.c
index 2ef4904..54b88db 100644
--- a/xcache/xc_allocator_bestfit.c
+++ b/xcache/xc_allocator_bestfit.c
@@ -192,7 +192,8 @@ static XC_ALLOCATOR_FREE(xc_allocator_bestfit_free) /* {{{ return block size fre
cur = (xc_allocator_bestfit_block_t *) (CHAR_PTR(p) - BLOCK_HEADER_SIZE());
TRACE("freeing: %p, size=%lu", p, cur->size);
xc_block_check(cur);
- assert((char*)allocator < (char*)cur && (char*)cur < (char*)allocator + allocator->size);
+ assert((char*)allocator < (char*)cur);
+ assert((char*)cur < (char*)allocator + allocator->size);
/* find free block right before the p */
b = allocator->headblock;
diff --git a/xcache/xc_utils.c b/xcache/xc_utils.c
index 43933ea..461901a 100644
--- a/xcache/xc_utils.c
+++ b/xcache/xc_utils.c
@@ -156,7 +156,8 @@ int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC) /* {{{ */
# ifdef ZEND_FAST_CALL
case ZEND_FAST_CALL:
# endif
- assert(Z_OP(opline->op1).jmp_addr >= op_array->opcodes && (zend_uint) (Z_OP(opline->op1).jmp_addr - op_array->opcodes) < op_array->last);
+ assert(Z_OP(opline->op1).jmp_addr >= op_array->opcodes);
+ assert((zend_uint) (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;
break;
case ZEND_JMPZ:
@@ -169,7 +170,8 @@ int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC) /* {{{ */
# ifdef ZEND_JMP_SET_VAR
case ZEND_JMP_SET_VAR:
# endif
- assert(Z_OP(opline->op2).jmp_addr >= op_array->opcodes && (zend_uint) (Z_OP(opline->op2).jmp_addr - op_array->opcodes) < op_array->last);
+ assert(Z_OP(opline->op2).jmp_addr >= op_array->opcodes);
+ assert((zend_uint) (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;
break;
}