]> andersk Git - splint.git/blobdiff - src/ctype.c
Made allocations involving sizeof work correctly (test/malloc.c).
[splint.git] / src / ctype.c
index 1ea98e0e6b58334f51e95599b99ed456355e8c4e..8253a71322221fd2a311ca5efe8751eebc3a622d 100644 (file)
@@ -460,7 +460,8 @@ ctype_baseArrayPtr (ctype c)
 
       if (ctype_isBroken (clp))
        {
-         llbuglit ("ctype_baseArrayPtr: bogus ctype");
+         llcontbug (message ("ctype_baseArrayPtr: bogus ctype getting base of: %s", ctype_unparse (c)));
+         return ctype_unknown;
        }
 
       return clp;
@@ -1954,8 +1955,7 @@ ctype_dump (ctype c)
   
   if (ctype_isUA (c))
     {
-      cstring tname = usymtab_getTypeEntryName 
-        (usymtab_convertId (ctype_typeId (c)));
+      cstring tname = usymtab_getTypeEntryName (usymtab_convertTypeId (ctype_typeId (c)));
       
       if (cstring_equal (tname, context_getBoolName ()))
        {
@@ -2296,7 +2296,10 @@ bool ctype_isRefCounted (ctype t)
 
 bool ctype_isVisiblySharable (ctype t)
 {
-  if (ctype_isUnknown (t)) return TRUE;
+  if (ctype_isUnknown (t))
+    {
+      return TRUE;
+    }
 
   if (ctype_isConj (t))
     {
@@ -2312,7 +2315,14 @@ bool ctype_isVisiblySharable (ctype t)
 
          if (rt == t)
            {
-             return TRUE;
+             if (ctype_isNumAbstract (t))
+               {
+                 return FALSE;
+               }
+             else
+               {
+                 return TRUE;
+               }
            }
          else
            {
@@ -2829,7 +2839,7 @@ size_t ctype_getArraySize (ctype c)
 
 ctype ctype_biggerType (ctype c1, ctype c2)
 {
-  if (ctbase_isBigger (ctype_getCtbaseSafe (c2), ctype_getCtbaseSafe (c1)) )
+  if (ctbase_isBigger (ctype_getCtbaseSafe (c2), ctype_getCtbaseSafe (c1)))
     {
       return c2;
     }
@@ -2838,3 +2848,8 @@ ctype ctype_biggerType (ctype c1, ctype c2)
       return c1;
     }
 }
+
+int ctype_getSize (ctype c)
+{
+  return ctbase_getSize (ctype_getCtbaseSafe (ctype_realType (c)));
+}
This page took 0.041202 seconds and 4 git commands to generate.