From 5ca699106717f308d100314024bc7542bf573952 Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 25 Feb 2003 01:17:28 +0000 Subject: [PATCH] Some error messages around asserts. --- vvp/vpi_iter.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/vvp/vpi_iter.cc b/vvp/vpi_iter.cc index 8a9978b7b..e8ef8a862 100644 --- a/vvp/vpi_iter.cc +++ b/vvp/vpi_iter.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vpi_iter.cc,v 1.6 2003/02/17 00:58:38 steve Exp $" +#ident "$Id: vpi_iter.cc,v 1.7 2003/02/25 01:17:28 steve Exp $" #endif /* @@ -73,6 +73,20 @@ vpiHandle vpip_make_iterator(unsigned nargs, vpiHandle*args, */ vpiHandle vpi_scan(vpiHandle ref) { + if (ref == 0) { + vpi_printf("ERROR: NULL handle passed to vpi_scan.\n"); + assert(0); + return 0; + } + + if (ref->vpi_type->type_code != vpiIterator) { + vpi_printf("ERROR: vpi_scan argument is " + "inappropriate vpiType code %d\n", + ref->vpi_type->type_code); + assert(0); + return 0; + } + struct __vpiIterator*hp = (struct __vpiIterator*)ref; assert(ref); assert(ref->vpi_type->type_code == vpiIterator); @@ -90,6 +104,9 @@ vpiHandle vpi_scan(vpiHandle ref) /* * $Log: vpi_iter.cc,v $ + * Revision 1.7 2003/02/25 01:17:28 steve + * Some error messages around asserts. + * * Revision 1.6 2003/02/17 00:58:38 steve * Strict correctness of vpi_free_object results. *