X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/8250fa4a814c24d90cb21c143b24b8769128a0fb..3dabb0778770a6ee8a2af1a104325e2651933ce1:/src/mtContextNode.c?ds=sidebyside diff --git a/src/mtContextNode.c b/src/mtContextNode.c index 6c620ba..4cc6e9e 100644 --- a/src/mtContextNode.c +++ b/src/mtContextNode.c @@ -1,6 +1,6 @@ /* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2001 University of Virginia, +** Splint - annotation-assisted static program checker +** Copyright (C) 1994-2002 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 more information: http://lclint.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 */ /* ** mtContextNode.c */ -# include "lclintMacros.nf" +# include "splintMacros.nf" # include "basic.h" static bool mtContextNode_matchesType (mtContextNode, ctype) /*@*/ ; @@ -184,7 +184,8 @@ bool mtContextNode_matchesRef (mtContextNode context, sRef sr) bool mtContextNode_matchesRefStrict (mtContextNode context, sRef s) { - if (mtContextNode_matchesRef (context, s)) + if (mtContextNode_isDefined (context) + && mtContextNode_matchesRef (context, s)) { if (ctype_isKnown (context->type) && (ctype_isUnknown (sRef_getType (s)) @@ -204,6 +205,7 @@ bool mtContextNode_matchesRefStrict (mtContextNode context, sRef s) bool mtContextNode_matchesType (mtContextNode context, ctype ct) { DPRINTF (("Context type...")); + llassert (mtContextNode_isDefined (context)); if (!ctype_match (context->type, ct)) { @@ -230,6 +232,8 @@ bool mtContextNode_matchesType (mtContextNode context, ctype ct) cstring mtContextNode_unparse (mtContextNode node) { + llassert (mtContextNode_isDefined (node)); + if (ctype_isKnown (node->type)) { return message ("%s %s", mtContextKind_unparse (node->context),