# include "exprChecks.h"
# include "aliasChecks.h"
# include "exprNodeSList.h"
-//# include "exprData.i"
/*@access constraint, exprNode @*/
temp = constraintList_subsumeEnsures (list2, ret);
temp = constraintList_addList (temp, ret);
-
+ constraintList_free(ret);
+
DPRINTF(( message ("constraintList_mergeEnsures: returning %s ",
constraintList_print(temp) )
));
DPRINTF((message ("constraintList_mergeRequires: ret = %s", constraintList_print(ret) ) ) );
- ret = constraintList_addList (ret, temp);
+ ret = constraintList_addListFree (ret, temp);
DPRINTF((message ("constraintList_mergeRequires: returning %s", constraintList_print(ret) ) ) );
if (preconditions != constraintList_undefined)
{
- preconditions= constraintList_togglePost (preconditions);
+ preconditions = constraintList_togglePost (preconditions);
+ preconditions = constraintList_preserveCallInfo(preconditions, fcn);
preconditions = constraintList_doSRefFixConstraintParam (preconditions, arglist);
}
else
if (preconditions == NULL)
preconditions = constraintList_makeNew();
}
-
+ DPRINTF (( message("Done checkCall\n") ));
+ DPRINTF (( message("Returning list %q ", constraintList_printDetailed(preconditions) ) ));
return preconditions;
}
//so we don't want to store the result but we do it anyway
temp2 = constraint_copy (temp);
// if (context_getFlag (FLG_ORCONSTRAINT) )
- temp2 = inequalitySubstitute (temp2, post1);
- if (!resolve (temp2, post1) )
- {
- temp2 = inequalitySubstituteUnsound (temp2, post1);
- if (!resolve (temp2, post1) )
- ret = constraintList_add (ret, temp2);
- }
+ temp2 = inequalitySubstitute (temp2, post1);
+ if (!resolve (temp2, post1) )
+ {
+ temp2 = inequalitySubstituteUnsound (temp2, post1);
+ if (!resolve (temp2, post1) )
+ ret = constraintList_add (ret, temp2);
+ else
+ constraint_free(temp2);
+ }
+ else
+ {
+ constraint_free(temp2);
+ }
}
constraint_free(temp);
}
if (*resolved)
{
- constraint_free(next);
- constraint_free(ret);
- return NULL;
+ if (next != NULL)
+ constraint_free(next);
+
+ /*we don't need to free ret when resolved is false because ret is null*/
+ llassert(ret == NULL);
+
+ return NULL;
}
while (next != NULL)
curr = doResolve (curr, post1, resolved);
if (*resolved)
{
- constraint_free(curr);
- constraint_free(next);
+ /* curr is null so we don't try to free it*/
+ llassert(curr == NULL);
+
+ if (next != NULL)
+ constraint_free(next);
+
constraint_free(ret);
return NULL;
}
ret = constraint_addOr (ret, curr);
+ constraint_free(curr);
}
- constraint_free(curr);
+
return ret;
}
{
ret = constraintList_add(ret, temp);
}
+ else
+ {
+ /*we don't need to free ret when resolved is false because ret is null*/
+ llassert(temp == NULL);
+ }
+
} end_constraintList_elements;
DPRINTF((message ("reflectChangesOr: returning %s", constraintList_print(ret) ) ) );
if (!resolve (temp, post1) )
ret = constraintList_add (ret, temp);
+ else
+ constraint_free(temp);
}
else
{
constraintList_elements(target, el)
{
constraint temp;
- #warning make sure this side effect is the right things
#warning make sure that a side effect is not expected
temp = substitute(el, subList);
return ret;
}
-constraint constraint_solve (constraint c)
+constraint constraint_solve (/*@returned@*/ constraint c)
{
DPRINTF( (message ("Solving %s\n", constraint_print(c) ) ) );
c->expr = constraintExpr_solveBinaryExpr (c->lexpr, c->expr);