Module Name: src
Committed By: yamt
Date: Thu May 19 10:01:21 UTC 2011
Modified Files:
src/common/lib/libc/gen: radixtree.c
Log Message:
radixtree: assertions
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/gen/radixtree.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/common/lib/libc/gen/radixtree.c
diff -u src/common/lib/libc/gen/radixtree.c:1.5 src/common/lib/libc/gen/radixtree.c:1.6
--- src/common/lib/libc/gen/radixtree.c:1.5 Thu May 19 10:00:30 2011
+++ src/common/lib/libc/gen/radixtree.c Thu May 19 10:01:21 2011
@@ -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;
}