ia64/xen-unstable

changeset 8738:03382076472c

Add argument-checking assertions to rangeset interfaces.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Feb 02 15:09:39 2006 +0100 (2006-02-02)
parents 1987bb42110a
children 5d9f4e6c9519
files xen/common/rangeset.c
line diff
     1.1 --- a/xen/common/rangeset.c	Thu Feb 02 13:57:18 2006 +0000
     1.2 +++ b/xen/common/rangeset.c	Thu Feb 02 15:09:39 2006 +0100
     1.3 @@ -95,6 +95,8 @@ int rangeset_add_range(
     1.4      struct range *x, *y;
     1.5      int rc = 0;
     1.6  
     1.7 +    ASSERT(s <= e);
     1.8 +
     1.9      spin_lock(&r->lock);
    1.10  
    1.11      x = find_range(r, s);
    1.12 @@ -161,6 +163,8 @@ int rangeset_remove_range(
    1.13      struct range *x, *y, *t;
    1.14      int rc = 0;
    1.15  
    1.16 +    ASSERT(s <= e);
    1.17 +
    1.18      spin_lock(&r->lock);
    1.19  
    1.20      x = find_range(r, s);
    1.21 @@ -227,6 +231,8 @@ int rangeset_contains_range(
    1.22      struct range *x;
    1.23      int contains;
    1.24  
    1.25 +    ASSERT(s <= e);
    1.26 +
    1.27      spin_lock(&r->lock);
    1.28      x = find_range(r, s);
    1.29      contains = (x && (x->e >= e));