summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-06-05 17:40:09 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-06-05 17:40:09 +0000
commitf47bbb15f8e7e60f27c533327f0d2436fb1b4d9b (patch)
treeab1069853cb24fd50285a05c006cf8123a06577c
parentd769da4cb4f01b8ffac0f52606bbf5075b19ba7c (diff)
DIAGNOSTIC check for duplicate entry into the tree.
niels@ ok.
-rw-r--r--sys/uvm/uvm_map.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 425d610df52..509b93d73cd 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.46 2002/04/29 06:26:51 pvalchev Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.47 2002/06/05 17:40:08 art Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -264,9 +264,14 @@ static __inline void
uvm_rb_insert(vm_map_t map, vm_map_entry_t entry)
{
vaddr_t space = uvm_rb_space(map, entry);
+ vm_map_entry_t tmp;
entry->ownspace = entry->space = space;
- RB_INSERT(uvm_tree, &(map)->rbhead, entry);
+ tmp = RB_INSERT(uvm_tree, &(map)->rbhead, entry);
+#ifdef DIAGNOSTIC
+ if (tmp != NULL)
+ panic("uvm_rb_insert: duplicate entry?");
+#endif
uvm_rb_fixup(map, entry);
if (entry->prev != &map->header)
uvm_rb_fixup(map, entry->prev);