]> andersk Git - splint.git/blobdiff - src/functionConstraint.c
noexpand always false.
[splint.git] / src / functionConstraint.c
index 39415ca2812d81265c30a9bdcd226dbd669f8df0..4bed9ac4b97a73bad84a979b18b7f931e992e2d4 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 ** MA 02111-1307, USA.
 **
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
+** For information on splint: info@splint.org
+** To report a bug: splint-bug@splint.org
 ** For more information: http://www.splint.org
 */
 /*
 ** functionConstraint.c
 */
 
-# include "lclintMacros.nf"
+# include "splintMacros.nf"
 # include "basic.h"
 
-static /*@only@*/ /*@notnull@*/ /*@special@*/ functionConstraint  /*@i32 need special? @*/
+static /*@only@*/ /*@notnull@*/ /*@special@*/ functionConstraint 
 functionConstraint_alloc (functionConstraintKind kind) /*@defines result->kind@*/
 {
   functionConstraint res = (functionConstraint) dmalloc (sizeof (*res));
@@ -91,6 +91,7 @@ extern constraintList functionConstraint_getBufferConstraints (functionConstrain
     {
       if (node->kind == FCT_CONJUNCT)
        {
+         /* make sure this is safe*/
          return constraintList_addListFree (functionConstraint_getBufferConstraints (node->constraint.conjunct.op1),
                                             functionConstraint_getBufferConstraints (node->constraint.conjunct.op2));
        }
@@ -218,11 +219,36 @@ extern void functionConstraint_free (/*@only@*/ functionConstraint node)
     }
 }
 
+/*drl modified */
+void functionConstraint_addBufferConstraints (functionConstraint node, constraintList 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_addListFree(node->constraint.buffer, temp);
+           }
+         else
+           {
+             constraintList_free (temp);
+             return;
+           }
+       }
+    }
+  else
+    {
+      constraintList_free (temp);
+      return;
+    }
+}
This page took 0.029063 seconds and 4 git commands to generate.