Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/gen radixtree: assertions



details:   https://anonhg.NetBSD.org/src/rev/0f5ad37ee952
branches:  trunk
changeset: 765106:0f5ad37ee952
user:      yamt <yamt%NetBSD.org@localhost>
date:      Thu May 19 10:01:21 2011 +0000

description:
radixtree: assertions

diffstat:

 common/lib/libc/gen/radixtree.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 3541e56c1405 -r 0f5ad37ee952 common/lib/libc/gen/radixtree.c
--- a/common/lib/libc/gen/radixtree.c   Thu May 19 10:00:30 2011 +0000
+++ b/common/lib/libc/gen/radixtree.c   Thu May 19 10:01:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radixtree.c,v 1.5 2011/05/19 10:00:30 yamt Exp $       */
+/*     $NetBSD: radixtree.c,v 1.6 2011/05/19 10:01:21 yamt Exp $       */
 
 /*-
  * Copyright (c)2011 YAMAMOTO Takashi,
@@ -41,7 +41,7 @@
 #include <sys/cdefs.h>
 
 #if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.5 2011/05/19 10:00:30 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.6 2011/05/19 10:01:21 yamt Exp $");
 #include <sys/param.h>
 #include <sys/errno.h>
 #include <sys/pool.h>
@@ -51,7 +51,7 @@
 #include <lib/libsa/stand.h>
 #endif /* defined(_STANDALONE) */
 #else /* defined(_KERNEL) || defined(_STANDALONE) */
-__RCSID("$NetBSD: radixtree.c,v 1.5 2011/05/19 10:00:30 yamt Exp $");
+__RCSID("$NetBSD: radixtree.c,v 1.6 2011/05/19 10:01:21 yamt Exp $");
 #include <assert.h>
 #include <errno.h>
 #include <stdbool.h>
@@ -112,6 +112,8 @@
 tagid_to_mask(radix_tree_tagid_t id)
 {
 
+       KASSERT(id >= 0);
+       KASSERT(id < RADIX_TREE_TAG_ID_MAX);
        return 1U << id;
 }
 



Home | Main Index | Thread Index | Old Index