From f47bbb15f8e7e60f27c533327f0d2436fb1b4d9b Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Wed, 5 Jun 2002 17:40:09 +0000 Subject: DIAGNOSTIC check for duplicate entry into the tree. niels@ ok. --- sys/uvm/uvm_map.c | 9 +++++++-- 1 file 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); -- cgit v1.2.3