/*@-fcnuse*/
/*@-assignexpose*/
-constraint constraint_makeNew (void);
+/*@notnull@*/ constraint constraint_makeNew (void);
constraint makeConstraintParse (sRef x, lltok relOp, exprNode cconstant)
else if (relOp.tok == EQ_OP)
ret->ar = EQ;
else
- llfatalbug("Unsupported relational operator");
+ llfatalbug(message ("Unsupported relational operator") );
t = cstring_toCharsSafe (exprNode_unparse(cconstant));
int c;
constraint ret;
ret = constraint_makeNew();
- llassert (l);
+ llassert (l!=NULL);
if (!l)
return ret;
else if (relOp.tok == EQ_OP)
ret->ar = EQ;
else
- llfatalbug("Unsupported relational operator");
+ llfatalbug(message("Unsupported relational operator") );
t = cstring_toCharsSafe (exprNode_unparse(cconstant));
{
constraint ret;
ret = constraint_makeNew();
- llassert (l);
+ llassert (l !=NULL);
if (!l)
return ret;
else if (relOp.tok == EQ_OP)
ret->ar = EQ;
else
- llfatalbug("Unsupported relational operator");
+ llfatalbug( message("Unsupported relational operator") );
ret->expr = constraintExpr_copy (r);
ret->ar = c->ar;
ret->expr = constraintExpr_copy (c->expr);
ret->post = c->post;
- ret->generatingExpr = c->generatingExpr;
+ ret->generatingExpr = exprNode_fakeCopy(c->generatingExpr);
/*@i33 fix this*/
if (c->orig != NULL)
c1->orig = constraint_copy (c2->orig);
else
c1->orig = NULL;
- c1->generatingExpr = c2->generatingExpr;
+ c1->generatingExpr = exprNode_fakeCopy (c2->generatingExpr );
}
bool constraint_resolve (/*@unused@*/ constraint c)
-constraint constraint_makeNew (void)
+/*@notnull@*/ constraint constraint_makeNew (void)
{
constraint ret;
ret = dmalloc(sizeof (*ret) );
ret->post = FALSE;
ret->orig = NULL;
ret->generatingExpr = NULL;
- /*@i23*/return ret;
+ return ret;
}
constraint constraint_addGeneratingExpr (/*@returned@*/ constraint c, exprNode e)
if (c->generatingExpr == NULL)
{
- c->generatingExpr = e;
+ c->generatingExpr = exprNode_fakeCopy(e);
DPRINTF ((message ("setting generatingExpr for %s to %s", constraint_print(c), exprNode_unparse(e) ) ));
}
else
bool constraint_hasMaxSet(constraint c)
{
- if (c->orig)
+ if (c->orig != NULL)
{
if (checkForMaxSet(c->orig) )
return TRUE;
// }
-cstring arithType_print (arithType ar)
+cstring arithType_print (arithType ar) /*@*/
{
cstring st = cstring_undefined;
switch (ar)
errorLoc = loc;
if (constraint_getFileloc(c) )
- errorLoc = constraint_getFileloc(c);
-
+ /*@-branchstate@*/
+ errorLoc = constraint_getFileloc(c);
+ /*@=branchstate@*/
if (c->post)
{
if (!c->post)
{
- if (c->orig)
+ if (c->orig != NULL)
st = message ("Unresolved constraint:\nLclint is unable to resolve %s needed to satisfy %s", constraint_print (c), constraint_print(c->orig) );
else
st = message ("Unresolved constraint:\nLclint is unable to resolve %s", constraint_print (c));
}
else
{
- if (c->orig)
+ if (c->orig != NULL)
st = message ("Block Post condition:\nThis function block has the post condition %s\n based on %s", constraint_print (c), constraint_print(c->orig) );
else
st = message ("Block Post condition:\nThis function block has the post condition %s", constraint_print (c));
{
cstring st = cstring_undefined;
cstring type = cstring_undefined;
- llassert (c);
+ llassert (c !=NULL);
if (c->post)
{
type = cstring_makeLiteral ("Ensures: ");
return st;
}
-constraint constraint_doSRefFixBaseParam (constraint precondition,
+/*@only@*/ constraint constraint_doSRefFixBaseParam (/*@returned@*/ /*@only@*/ constraint precondition,
exprNodeList arglist)
{
precondition->lexpr = constraintExpr_doSRefFixBaseParam (precondition->lexpr,
// return FALSE;
// }
-constraint constraint_preserveOrig (constraint c)
+/*@only@*/ constraint constraint_preserveOrig (/*@returned@*/ /*@only@*/ constraint c) /*@modifies c @*/
{
c->orig = constraint_copy (c);
return c;