]> andersk Git - splint.git/blobdiff - src/functionConstraint.c
Added support for default buffer constraint annotations
[splint.git] / src / functionConstraint.c
index 5a30602f881c0a95c52e6d5731874054b3c1d6d0..785e2f37903443a5db14289f09f222bcc7da43d3 100644 (file)
@@ -219,9 +219,36 @@ extern void functionConstraint_free (/*@only@*/ functionConstraint node)
     }
 }
 
-void functionConstraint_addBufferConstraints (functionConstraint fc, constraintList clist) 
+/*drl modified */
+void functionConstraint_addBufferConstraints (functionConstraint node, constraintList clist) 
 {
-  llassert (functionConstraint_isBufferConstraint (fc));
-  fc->constraint.buffer  = constraintList_addList (fc->constraint.buffer, clist);
-}
+  constraintList temp;
 
+  temp = constraintList_copy (clist);
+  
+  if (functionConstraint_isDefined (node))
+    {
+      if (node->kind == FCT_CONJUNCT)
+       {
+         functionConstraint_addBufferConstraints (node->constraint.conjunct.op1, constraintList_copy(temp) );
+         functionConstraint_addBufferConstraints (node->constraint.conjunct.op2,temp);
+       }
+      else
+       {
+         if (node->kind == FCT_BUFFER)
+           {
+             node->constraint.buffer = constraintList_addList(node->constraint.buffer, temp);
+           }
+         else
+           {
+             constraintList_free (temp);
+             return;
+           }
+       }
+    }
+  else
+    {
+      constraintList_free (temp);
+      return;
+    }
+}
This page took 0.029045 seconds and 4 git commands to generate.