]> andersk Git - splint.git/commitdiff
Passes the standard LCLint test suite. YAAAAAAYYYY!!!!!
authordrl7x <drl7x>
Wed, 29 Nov 2000 09:48:39 +0000 (09:48 +0000)
committerdrl7x <drl7x>
Wed, 29 Nov 2000 09:48:39 +0000 (09:48 +0000)
YAAAAAAAAAAYYYYYYYYYYYYYYYYY!!!!!!!!!!!!!!!!

src/Headers/herald.h
src/Headers/herald.last
src/cgrammar.tab.c
src/constraint.c
src/constraintGeneration.c
src/exprChecks.c
src/exprNode.c
src/sRef.c

index 05019e4375ea28780107f6dcff370ed36858bfb0..d585e600e580ecfb5f75fcc2d4cb0808dc3ab787 100644 (file)
@@ -4,4 +4,4 @@
 /*@constant observer char *LCL_PARSE_VERSION;@*/
 # define LCL_PARSE_VERSION "LCLint 2.5q"
 /*@constant observer char *LCL_COMPILE;@*/
-# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 on SunOS mamba.cs.Virginia.EDU 5.6 Generic_105181-09 sun4u sparc SUNW,Ultra-60 by drl7x"
+# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 -g on FreeBSD shankly.cs.virginia.edu 3.2-RELEASE FreeBSD 3.2-RELEASE #0: Tue May 18 04:05:08 GMT 1999 jkh@cathair:/usr/src/sys/compile/GENERIC i386 by drl7x"
index 424bb62b05f248db5df4b036e88e0f5f7710fafc..d585e600e580ecfb5f75fcc2d4cb0808dc3ab787 100644 (file)
@@ -4,4 +4,4 @@
 /*@constant observer char *LCL_PARSE_VERSION;@*/
 # define LCL_PARSE_VERSION "LCLint 2.5q"
 /*@constant observer char *LCL_COMPILE;@*/
-# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 -g -Wall on SunOS mamba.cs.Virginia.EDU 5.6 Generic_105181-09 sun4u sparc SUNW,Ultra-60 by drl7x"
+# define LCL_COMPILE "Compiled using gcc -DSTDC_HEADERS=1 -g on FreeBSD shankly.cs.virginia.edu 3.2-RELEASE FreeBSD 3.2-RELEASE #0: Tue May 18 04:05:08 GMT 1999 jkh@cathair:/usr/src/sys/compile/GENERIC i386 by drl7x"
index 1ef00397b78082bcad410fc7de0f1d4aefc0a173..7ca1ed08a89e719d412724460cc79f4b84e84cc0 100644 (file)
@@ -2567,7 +2567,7 @@ static const short yycheck[] = {     0,
     -1,    -1,    -1,    -1,   184,    -1,    -1,    -1,   188
 };
 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/gnu/share/bison.simple"
+#line 3 "/usr/share/misc/bison.simple"
 
 /* Skeleton output parser for bison,
    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -2760,7 +2760,7 @@ __yy_memcpy (char *to, char *from, int count)
 #endif
 #endif
 \f
-#line 196 "/gnu/share/bison.simple"
+#line 196 "/usr/share/misc/bison.simple"
 
 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
    into yyparse.  The argument should have type void *.
@@ -5392,7 +5392,7 @@ case 657:
     break;}
 }
    /* the action file gets copied in in place of this dollarsign */
-#line 498 "/gnu/share/bison.simple"
+#line 498 "/usr/share/misc/bison.simple"
 \f
   yyvsp -= yylen;
   yyssp -= yylen;
index 6c3b069569bc7ed76e9c9be5badacbbabd92c2ba..826d9b4eb0a1482fcf4c848536b4c2e963d6485c 100644 (file)
@@ -267,6 +267,13 @@ static constraint constraint_makeEnsuresOp (exprNode e1, exprNode e2, fileloc se
   exprNode e;
   
   e = exprNode_fakeCopy(e1);
+  if (! (e1 && e2) )
+    {
+      TPRINTF((message("Warning null exprNode, Exprnodes are %s and %s",
+                      exprNode_unparse(e1), exprNode_unparse(e2) )
+              ));
+    }
+                      
   ret->lexpr = constraintExpr_makeValueExpr (e);
   ret->ar = ar;
   ret->post = TRUE;
index 2d4d64942b335071273ee8b531f23a9d81fa8eba..23d7e82a6d5400f1aa2c44fda9303fe3093ffed9 100644 (file)
@@ -103,12 +103,12 @@ bool /*@alt void@*/ exprNode_generateConstraints (/*@temp@*/ exprNode e)
   if (exprNode_isUnhandled (e) )
     {
       DPRINTF( (message("Warning ignoring %s", exprNode_unparse (e) ) ) );
-        e->requiresConstraints = constraintList_new();
-       e->ensuresConstraints = constraintList_new();
-       e->trueEnsuresConstraints = constraintList_new();
-       e->falseEnsuresConstraints = constraintList_new();
-       llassert(FALSE);
-       return FALSE;
+      e->requiresConstraints = constraintList_new();
+      e->ensuresConstraints = constraintList_new();
+      e->trueEnsuresConstraints = constraintList_new();
+      e->falseEnsuresConstraints = constraintList_new();
+      //  llassert(FALSE);
+      return FALSE;
     }
 
   
@@ -196,7 +196,9 @@ bool exprNode_stmt (exprNode e)
        {
          return exprNode_multiStatement (e );
        }
-      //  llassert(FALSE);
+      BPRINTF( (message ("Ignoring non-statement %s", exprNode_unparse(e) ) ) );
+      return TRUE;
+      //      llassert(FALSE);
     }
  
   DPRINTF (("Stmt") );
@@ -286,7 +288,7 @@ constraintList constraintList_makeFixedArrayConstraints (sRefSet s)
  
   sRefSet_elements (s, el)
     {
-    llassert (el);
+      //    llassert (el);
     if (sRef_isFixedArray(el) )
       {
        int s;
@@ -393,6 +395,12 @@ bool exprNode_multiStatement (exprNode e)
       test =   exprData_getTripleTest (forPred->edata);
       inc  =   exprData_getTripleInc (forPred->edata);
 
+      if ( ( (exprNode_isError (test) || (exprNode_isError(init) ) || (exprNode_isError) ) ) )
+       {
+         BPRINTF (("strange for statement:%s, ignoring it", exprNode_unparse(e) ) );
+         return ret;
+       }
+      
       test->trueEnsuresConstraints =  exprNode_traversTrueEnsuresConstraints(test);
       //      e->requiresConstraints = reflectChanges (body->requiresConstraints, test->trueEnsuresConstraints);
       e->requiresConstraints = reflectChanges (e->requiresConstraints, test->ensuresConstraints);
@@ -664,7 +672,7 @@ bool exprNode_exprTraverse (exprNode e, bool definatelv, bool definaterv,  filel
   exprData data;
   constraint cons;
 
-     if (exprNode_handleError (e))
+     if (exprNode_isError(e) )
      {
        return FALSE;
      }
@@ -677,6 +685,10 @@ bool exprNode_exprTraverse (exprNode e, bool definatelv, bool definaterv,  filel
    e->trueEnsuresConstraints = constraintList_new();;
    e->falseEnsuresConstraints = constraintList_new();;
 
+   if (exprNode_isUnhandled (e) )
+     {
+       return FALSE;
+     }
    //   e = makeDataTypeConstraints (e);
  
    handledExprNode = TRUE;
@@ -758,11 +770,13 @@ bool exprNode_exprTraverse (exprNode e, bool definatelv, bool definaterv,  filel
       lltok_unparse (exprData_getOpTok (data));
       exprNode_exprTraverse (t2, definatelv, TRUE, sequencePoint );
 
-      //      DPRINTF ( ("Doing ASSign"));
-      cons =  constraint_makeEnsureEqual (t1, t2, sequencePoint);
+      /* this test is nessecary because some expressions generate a null expression node.  function pointer do that -- drl */
+      if ( (!exprNode_isError (t1))  &&  (!exprNode_isError(t2)) )
+       {
+         cons =  constraint_makeEnsureEqual (t1, t2, sequencePoint);
+         e->ensuresConstraints = constraintList_add(e->ensuresConstraints, cons);
+       }
       
-      e->ensuresConstraints = constraintList_add(e->ensuresConstraints, cons);
-
       break;
     case XPR_OP:
       t1 = exprData_getOpA (data);
index cbcae41ac34155b8b9dd8b31988e9fce0ccf2de9..b638d6fac3584a235864d07690f9d9f5af1a72dd 100644 (file)
@@ -896,7 +896,8 @@ void exprNode_checkFunction (/*@unused@*/ uentry ue, /*@only@*/ exprNode body)
   constraintList c, t;
   /* drl added 8-8-2000 */
 
-  return;
+  //return;
+  
   exprNode_generateConstraints (body);
   
   c =   uentry_getFcnPreconditions (ue);
index 7ab4115e318f98acf3b2513048907ca6bcd87a09..c6c528b949a7b3e0297be15242558fed4ebdffc7 100644 (file)
@@ -6409,9 +6409,9 @@ exprNode exprNode_while (/*@keep@*/ exprNode t, /*@keep@*/ exprNode b)
   exprNode ret;
   bool emptyErr = FALSE;
   char *s;
-  s = exprNode_generateConstraints (t);
+  //  s = exprNode_generateConstraints (t);
   // printf("pred: %s\n", s);
-  s = exprNode_generateConstraints (b);
+  // s = exprNode_generateConstraints (b);
   //printf ("body: %s\n", s);
   //constraintList_print(b->constraints);
   
index d776cc416ab418bf72f3829e1883a4c4b711175b..9c8e80250c61723939f179a68482059d906df3e0 100644 (file)
@@ -2818,7 +2818,7 @@ sRef_unparseNoArgs (sRef s)
     case SK_UNKNOWN:
       return cstring_makeLiteral ("?");
     case SK_PARAM:
-       llcontbug (message ("sRef_unparseNoArgs: bad case: %q", sRef_unparseDebug (s))); 
+      /* llcontbug (message ("sRef_unparseNoArgs: bad case: %q", sRef_unparseDebug (s))); */
       return (sRef_unparseDebug (s));
     }
   BADEXIT;
This page took 0.107794 seconds and 5 git commands to generate.