From cbb4319fb9f02da2a71c69cf9f54e03ba81c8846 Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 25 Feb 1997 23:28:09 +0000 Subject: [PATCH] vm_object_shadow(): Add a DIAGNOSTIC check for shadowing a null object. From Charles Hannum --- sys/vm/vm_object.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 48e8627b8d8d..0a474ac55c90 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_object.c,v 1.44 1997/02/24 22:19:26 thorpej Exp $ */ +/* $NetBSD: vm_object.c,v 1.45 1997/02/25 23:28:09 thorpej Exp $ */ /*- * Copyright (c) 1997 Charles M. Hannum. All rights reserved. @@ -896,6 +896,11 @@ vm_object_shadow(object, offset, length) source = *object; +#ifdef DIAGNOSTIC + if (source == NULL) + panic("vm_object_shadow: attempt to shadow null object"); +#endif + /* * Allocate a new object with the given length */