]> andersk Git - splint.git/blobdiff - src/sRef.c
Merged with Dave Evans's changes.
[splint.git] / src / sRef.c
index e285fa07561a5916df75339797536381d6693730..2decf92745dae0f93a27c9113d310e7a0f69d284 100644 (file)
@@ -2044,7 +2044,7 @@ sRef_closeEnough (sRef s1, sRef s2)
   s is an sRef of a formal paramenter in a function call constraint
   we trys to return a constraint expression derived from the actual parementer of a function call.
 */
-constraintExpr sRef_fixConstraintParam ( sRef s, exprNodeList args)
+/*@only@*/ constraintExpr sRef_fixConstraintParam (/*@observer@*/  sRef s, /*@observer@*/ /*@temp@*/ exprNodeList args)
 {
   constraintExpr ce;
 
@@ -2055,6 +2055,7 @@ constraintExpr sRef_fixConstraintParam ( sRef s, exprNodeList args)
     {
     case SK_RESULT:
       {
+       //      s = sRef_saveCopy(s);
        ce = constraintExpr_makeTermsRef (s);
        return ce;
       }
@@ -2071,6 +2072,7 @@ constraintExpr sRef_fixConstraintParam ( sRef s, exprNodeList args)
       {
        sRef temp;
        temp = (sRef_makePointer (sRef_fixBaseParam (s->info->ref, args)));
+       //temp = sRef_saveCopy(temp);
        ce = constraintExpr_makeTermsRef (temp);
        return ce;
       }
@@ -2078,13 +2080,18 @@ constraintExpr sRef_fixConstraintParam ( sRef s, exprNodeList args)
     case SK_ARRAYFETCH:
        {
        sRef temp;
-       temp = sRef_fixBaseParam (s, args);
+       temp = sRef_saveCopy(s);
+       temp = sRef_fixBaseParam (temp, args);
        ce = constraintExpr_makeTermsRef (temp);
        return ce;
       }
     case SK_CVAR:
-       ce = constraintExpr_makeTermsRef (s);
-       return ce;
+      {
+       sRef temp;
+       temp = sRef_saveCopy(s);
+       ce = constraintExpr_makeTermsRef (temp);
+       return ce;
+      }
     case SK_PARAM:
       llassert(exprNodeList_size (args) > s->info->paramno);
        {
@@ -2096,9 +2103,13 @@ constraintExpr sRef_fixConstraintParam ( sRef s, exprNodeList args)
        }
 
     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);
+      {
+       sRef temp;
+      llcontbug ((message("Trying to do fixConstraintParam on nonparam, nonglobal: %q for function with arguments %q", sRef_unparse (s), exprNodeList_unparse(args) ) ));
+      temp = sRef_saveCopy(s);
+      ce = constraintExpr_makeTermsRef (temp);
       return ce;
+      }
     }
 
   
@@ -9173,7 +9184,8 @@ bool sRef_isFixedArray (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 0.034716 seconds and 4 git commands to generate.