X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/77d3741943947b83a5d6a10a5e31650a1005dbde..5b99bfd6792ab9229bb5b1d9048833d21b22ecef:/src/aliasTable.c diff --git a/src/aliasTable.c b/src/aliasTable.c index 82bf80b..4773e39 100644 --- a/src/aliasTable.c +++ b/src/aliasTable.c @@ -1,6 +1,6 @@ /* ** Splint - annotation-assisted static program checker -** Copyright (C) 1994-2002 University of Virginia, +** Copyright (C) 1994-2003 University of Virginia, ** Massachusetts Institute of Technology ** ** This program is free software; you can redistribute it and/or modify it @@ -17,15 +17,15 @@ ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ** MA 02111-1307, USA. ** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu +** For information on splint: info@splint.org +** To report a bug: splint-bug@splint.org ** For more information: http://www.splint.org */ /* ** aliasTable.c */ -# include "lclintMacros.nf" +# include "splintMacros.nf" # include "basic.h" /*@constant int ATINVALID; @*/ @@ -51,8 +51,8 @@ aliasTable_newEmpty (void) s->nelements = 0; s->nspace = aliasTableBASESIZE; - s->keys = (sRef *) dmalloc (sizeof (*s->keys) * aliasTableBASESIZE); - s->values = (sRefSet *) dmalloc (sizeof (*s->values) * aliasTableBASESIZE); + s->keys = (sRef *) dmalloc (sizeof (*s->keys) * aliasTableBASESIZE); + s->values = (sRefSet *) dmalloc (sizeof (*s->values) * aliasTableBASESIZE); return (s); } @@ -94,6 +94,9 @@ static int aliasTable_lookupRefs (/*@notnull@*/ aliasTable s, sRef sr) { if (sRef_same (sr, s->keys[i])) { + DPRINTF (("sRef match: %s / %s", + sRef_unparseFull (sr), + sRef_unparseFull (s->keys[i]))); return i; } } @@ -824,5 +827,22 @@ aliasTable_checkGlobs (aliasTable t) } end_aliasTable_elements; } +# ifdef DEBUGSPLINT +/* +** For debugging only +*/ + +void aliasTable_checkValid (aliasTable t) +{ + aliasTable_elements (t, key, value) + { + sRef_checkCompletelyReasonable (key); + sRefSet_elements (value, sr) + { + sRef_checkCompletelyReasonable (sr); + } end_sRefSet_elements ; + } end_aliasTable_elements ; +} +# endif