]> andersk Git - splint.git/blobdiff - src/ctbase.i
Fixed bug reproted by Jim Francis. Bug was triggered by running splint on typedef...
[splint.git] / src / ctbase.i
index cea6f1846a237b7e0b8a6d13ffb4bc7c18cc090f..3b85bc813b93ae6657371e1ffbbe24f64c29e6bd 100644 (file)
@@ -277,7 +277,7 @@ static bool ctuid_isAP (ctuid c) /*@*/
 
 static typeId ctbase_typeId (ctbase p_c);
 static /*@only@*/ cstring ctbase_dump (ctbase p_c);
-static /*@only@*/ ctbase ctbase_undump (char **p_c);
+static /*@only@*/ ctbase ctbase_undump (char **p_c) /*@requires maxRead(*p_c) >= 2 @*/;
 static int ctbase_compare (ctbase p_c1, ctbase p_c2, bool p_strict);
 static bool ctbase_matchArg (ctbase p_c1, ctbase p_c2);
 static /*@notnull@*/ /*@only@*/ ctbase 
@@ -492,7 +492,8 @@ ctbase_unparse (ctbase c)
          return (message ("%t *", c->contents.base));
        }
     case CT_FIXEDARRAY:
-      return (message ("%t [%d]", c->contents.farray->base, 
+      return (message ("%t [%d]", 
+                      c->contents.farray->base, 
                       (int) c->contents.farray->size));
     case CT_ARRAY:
       return (message ("%t []", c->contents.base));
@@ -789,7 +790,7 @@ ctbase_unparseDeclaration (ctbase c, /*@only@*/ cstring name) /*@*/
   BADEXIT;
 }
 
-static ctbase ctbase_undump (d_char *c)
+static ctbase ctbase_undump (d_char *c) /*@requires maxRead(*c) >= 2 @*/
 {
   ctbase res;
   char p = **c;
@@ -943,7 +944,7 @@ static ctbase ctbase_undump (d_char *c)
       llerror (FLG_SYNTAX, 
               message ("Bad Library line (type): %s", cstring_fromChars (*c)));
 
-      while (**c != '\0')
+  /*drl bee: pbr*/      while (**c != '\0')
        {
          (*c)++;
        }
@@ -2501,10 +2502,16 @@ ctbase_almostEqual (ctbase c1, ctbase c2)
 
 long int ctbase_getArraySize (ctbase ctb)
 {
-  llassert (ctbase_isDefined (ctb) );
+  /*drl 1/25/2002 fixed discover by Jim Francis */
+  ctbase r;
+
   
-  llassert (ctbase_isFixedArray(ctb) );
+  llassert (ctbase_isDefined (ctb) );
+  r = ctbase_realType (ctb);
+  llassert (ctbase_isFixedArray(r) );
+
   
-  return (ctb->contents.farray->size);
+
+  return (r->contents.farray->size);
 
 }
This page took 0.047245 seconds and 4 git commands to generate.