]> andersk Git - splint.git/blobdiff - src/clabstract.c
Fixed bug #697722 Assert error / global
[splint.git] / src / clabstract.c
index 304d0edc97c209f6251a17f953928b755506cf24..1131f590095f1c4545310cedbe8a8d91dead79d3 100644 (file)
@@ -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
@@ -36,6 +36,8 @@
 # include "structNames.h"
 # include "nameChecks.h"
 
+# include "cscannerHelp.h"
+
 # ifdef SANITIZER
 # include "sgrammar_tokens.h"
 # else
@@ -512,41 +514,61 @@ void  setImplictfcnConstraints (void)
 
   if (constraintList_isDefined(implicitFcnConstraints) )
     constraintList_free(implicitFcnConstraints);
-   
+  
   implicitFcnConstraints  = constraintList_makeNew();
   
   uentryList_elements (params, el)
     {
       DPRINTF((message("setImplictfcnConstraints doing: %s", uentry_unparse(el) ) ));
       
-      s = uentry_getSref(el);
-      if (sRef_isReference (s) )
+      if ( uentry_isVariable (el) )
        {
-         DPRINTF((message ("%s is a pointer", sRef_unparse(s) ) ));
-       }
-      else
+         s = uentry_getSref(el);
+         if (sRef_isReference (s) )
+           {
+             
+             DPRINTF((message ("%s is a pointer", sRef_unparse(s) ) ));
+             /*drl 4/26/01
+               chagned this from MaxSet(s) == 0 to MaxSet(s) >= 0 */
+             c = constraint_makeSRefWriteSafeInt (s, 0);
+             
+             implicitFcnConstraints = constraintList_add(implicitFcnConstraints , c);
+             
+             /*drl 10/23/2002 added support for out*/
+
+             if (!uentry_isOut(el) )
+               {
+                 c = constraint_makeSRefReadSafeInt (s, 0);
+                 
+                 implicitFcnConstraints = constraintList_add(implicitFcnConstraints , c);
+               }
+           }
+         else
+           {
+             DPRINTF((message ("%s is NOT a pointer", sRef_unparse(s) ) ));
+           }
+       } /*end uentry_isVariable*/
+
+      else if (uentry_isElipsisMarker (el) )      
        {
-         DPRINTF((message ("%s is NOT a pointer", sRef_unparse(s) ) ));
+         /*just ignore these*/
+         ;
        }
-      /*drl 4/26/01
-       chagned this from MaxSet(s) == 0 to MaxSet(s) >= 0 */
-      c = constraint_makeSRefWriteSafeInt (s, 0);
       
-      implicitFcnConstraints = constraintList_add(implicitFcnConstraints , c);
-
-      /*drl 10/23/2002 added support for out*/
-      if (!uentry_isOut(el) )
+      else
        {
-         c = constraint_makeSRefReadSafeInt (s, 0);
-      
-         implicitFcnConstraints = constraintList_add(implicitFcnConstraints , c);
+         /*just ignore this
+           I'm not sure if this is possible though
+         */
+         /*@warning take this out befor@*/
+         llassert(FALSE);
        }
-       
-      
     }
+  
   end_uentryList_elements;
   DPRINTF((message("implicitFcnConstraints has been set to %s\n",
                   constraintList_print(implicitFcnConstraints) ) ));
+  
 }
 
 
@@ -2141,7 +2163,9 @@ sRef checkStateClausesId (uentry ue)
       voptgenerror 
        (FLG_COMMENTERROR,
         message ("Global variable %s used state clause.  (Global variables "
-                 "are not recognized in state clauses.  If there is "
+                 "are not recognized in state clauses.  If they are present "
+                 "they are ignored. "
+                 " If there is "
                  "sufficient interest in support for this, it may be "
                  "added to a future release.  Send mail to "
                  "info@splint.org.)",
This page took 0.102562 seconds and 4 git commands to generate.