]> andersk Git - splint.git/blobdiff - src/sRef.c
Removed the unused data type environmentTable.
[splint.git] / src / sRef.c
index 841622e355951368415837918d566eefd8c988df..0e6dc60eaf1dca4f7ffd0b7be5996d7b1774eee7 100644 (file)
@@ -2049,39 +2049,60 @@ constraintExpr sRef_fixConstraintParam ( sRef s, exprNodeList args)
   constraintExpr ce;
 
   if (sRef_isInvalid (s))
-    llfatalbug(("Invalid sRef"));
+    llfatalbug((message("Invalid sRef")));
 
-  if (s->kind == SK_RESULT)
-    {
-      ce = constraintExpr_makeTermsRef (s);
-      return ce;
-    }
-  if (s->kind != SK_PARAM)
+  switch (s->kind)
     {
-      if (s->kind != SK_CVAR)
+    case SK_RESULT:
+      {
+       ce = constraintExpr_makeTermsRef (s);
+       return ce;
+      }
+    case SK_FIELD:
+      {
+       sRef temp;
+       
+       temp = (sRef_makeField (sRef_fixBaseParam (s->info->field->rec, args),
+                             s->info->field->field));
+       ce = constraintExpr_makeTermsRef (temp);
+       return ce;
+      }
+    case SK_PTR:
+      {
+       sRef temp;
+       temp = (sRef_makePointer (sRef_fixBaseParam (s->info->ref, args)));
+       ce = constraintExpr_makeTermsRef (temp);
+       return ce;
+      }
+
+    case SK_ARRAYFETCH:
+       {
+       sRef temp;
+       temp = sRef_fixBaseParam (s, args);
+       ce = constraintExpr_makeTermsRef (temp);
+       return ce;
+      }
+    case SK_CVAR:
+       ce = constraintExpr_makeTermsRef (s);
+       return ce;
+    case SK_PARAM:
+      llassert(exprNodeList_size (args) > s->info->paramno);
        {
-         llcontbug ((message("Trying to do fixConstraintParam on nonparam, nonglobal: %s for function with arguments %s", sRef_unparse (s), exprNodeList_unparse(args) ) ));
+         exprNode e = exprNodeList_nth (args, s->info->paramno);
+
+         llassert( !(exprNode_isError (e)) );
+         ce = constraintExpr_makeExprNode (e);
+         return ce;
        }
+
+    default:
+      llcontbug ((message("Trying to do fixConstraintParam on nonparam, nonglobal: %s for function with arguments %s", sRef_unparse (s), exprNodeList_unparse(args) ) ));
       ce = constraintExpr_makeTermsRef (s);
       return ce;
     }
+
   
-  if (exprNodeList_size (args) > s->info->paramno)
-    {
-      exprNode e = exprNodeList_nth (args, s->info->paramno);
-      
-      if (exprNode_isError (e))
-       {
-         llassert (FALSE);
-       }
-      
-      ce = constraintExpr_makeExprNode (e);
-    }
-  else
-    {
-      llassert(FALSE);
-    }
-  return ce;
+
 }
 
 /*@exposed@*/ sRef
@@ -6755,6 +6776,10 @@ bool sRef_hasName (sRef s)
     }
 }
 
+bool sRef_sameObject (sRef s1, sRef s2)
+{
+  return sRef_sameName(s1, s2);
+}
 bool
 sRef_sameName (sRef s1, sRef s2)
 {
@@ -9139,16 +9164,17 @@ void sRef_resetLen(sRef p_s) {
 
 /*drl7x 11/28/2000 */
 
-bool sRef_isFixedArray (sRef p_s) {
+bool sRef_isFixedArray (sRef p_s) /*@*/ {
   ctype c;
   c = sRef_getType (p_s);
   return ( ctype_isFixedArray (c) );
 }
 
-int sRef_getArraySize (sRef p_s) {
+long int sRef_getArraySize (sRef p_s) /*@*/ {
   ctype c;
   llassert (sRef_isFixedArray(p_s) );
-
+  DPRINTF (( message ("sRef_getArraySize getting array size for %s", sRef_unparse(p_s) )  ));
+  
   c = sRef_getType (p_s);
 
   return (ctype_getArraySize (c) );
This page took 1.063137 seconds and 4 git commands to generate.