]> andersk Git - splint.git/commitdiff
Fixed internal errors for field assignments --- this is a temporary fix,
authorevans1629 <evans1629>
Wed, 6 Feb 2002 01:27:13 +0000 (01:27 +0000)
committerevans1629 <evans1629>
Wed, 6 Feb 2002 01:27:13 +0000 (01:27 +0000)
should probably report errors but I need to look into it.

src/llerror.c
src/osd.c
src/transferChecks.c

index 3b00e7e19bd30e7a6f1c86ddbd2c8ce4b773eb9f..7198b287c4406c7ec337dad2ea101cc92ff151ae 100644 (file)
@@ -1380,6 +1380,7 @@ void llbugaux (cstring file, int line, /*@only@*/ cstring s)
     }
 
   (void) fflush (g_msgstream);
+
   printError (stderr, message ("%q: *** Internal Bug at %q: %q [errno: %d]",
                               fileloc_unparse (g_currentloc),
                               fileloc_unparseRaw (file, line),
index 133f243ec5c55f11fa57f95c0d02d57b16dea377..5a352667ee239433d4b7ff41259a50fa6741b9c8 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -1023,6 +1023,8 @@ cstring osd_absolutePath (cstring cwd, cstring filename)
 ** is longer, then the full absolute filename is returned.
 **
 ** KNOWN BUG:   subpart of the original filename is actually a symbolic link.  
+**
+** this is really horrible code...surely someone has written a less buggy version of this!
 */
 
 cstring osd_outputPath (cstring filename)
@@ -1038,6 +1040,7 @@ cstring osd_outputPath (cstring filename)
   /*@access cstring@*/
   path_p = filename;
   rel_buf_p = rel_buffer = (char *) dmalloc (filename_len);
+  *rel_buf_p = '\0';
 
   llassert (cwd_p != NULL);
   llassert (path_p != NULL);
@@ -1060,6 +1063,11 @@ cstring osd_outputPath (cstring filename)
     }
   else
     {
+      /* evans 2002-02-05 This is horrible code, which I've removed.  I couldn't find any
+      ** test cases that need it, so I hope I'm not breaking anything.
+      */
+
+# if 0      
       if (*path_p != '\0')
         {
           --cwd_p;
@@ -1073,7 +1081,7 @@ cstring osd_outputPath (cstring filename)
           path_p++;
           unmatched_slash_count++;
         }
-      
+
       /* Find out how many directory levels in cwd were *not* matched.  */
       while (*cwd_p != '\0')
        {
@@ -1087,14 +1095,8 @@ cstring osd_outputPath (cstring filename)
        {
          return cstring_copy (filename);
        }
+# endif
       
-      /*
-      ** evans 2001-10-15
-      ** I'm trusting the code on this one...don't see how this is guaranteed though.
-      */
-
-      assertSet (rel_buffer);
-
       /* For each of them, put a `../' at the beginning of the short name.  */
       while (unmatched_slash_count-- > 0)
         {
@@ -1121,9 +1123,10 @@ cstring osd_outputPath (cstring filename)
            }
         } /*@-usereleased@*/
       while ((*rel_buf_p++ = *path_p++) != '\0') ;
-      /*@=usereleased@*/ /*@i523! shouldn't need these */
 
+      /*@=usereleased@*/ /*@i523! shouldn't need these */
       --rel_buf_p;
+
       if (*(rel_buf_p-1) == '/')
         *--rel_buf_p = '\0';
 
index 5cfe05273f5b493d5360bba3cd7225697d21d315..d46069123b03f53005564636d5f8c042aa8b1ec0 100644 (file)
@@ -505,7 +505,8 @@ checkCompletelyDefined (exprNode fexp, /*@exposed@*/ sRef fref, sRef ofref,
            {
              ; /* no error (will be a definition error) */
            }
-         else if (transferType == TT_DOASSIGN)
+         else if (transferType == TT_DOASSIGN || transferType == TT_FIELDASSIGN)
+           /* evans 2002-02-05 - added TT_FIELDASSIGN */
            {
              ; /* no error */
            }
@@ -775,6 +776,7 @@ checkCompletelyDefined (exprNode fexp, /*@exposed@*/ sRef fref, sRef ofref,
       else
        {
          llassert (transferType == TT_DOASSIGN
+                   || transferType == TT_FIELDASSIGN /* evans 2002-02-05 */
                    || transferType == TT_GLOBINIT
                    || transferType == TT_LEAVETRANS);
        }
This page took 0.056193 seconds and 5 git commands to generate.