{
llfatalerrorLoc (cstring_makeLiteral("Macro defined constants can not be used in function constraints unless they are specifed with the constant annotation. To use a macro defined constant include an annotation of the form /*@constant <type> <name>=<value>@*/ somewhere before the function constraint. This restriction may be removed in future releases if it is determined to be excessively burdensome." ));
}
- return sRef_saveCopy (sr); /*@i523 why the saveCopy? */
+
+ /*@ savedCopy to used to mitigate danger of accessing freed memory*/
+ return sRef_saveCopy (sr);
}
void checkModifiesId (uentry ue)
}
else
{
- /*@i222@*/
- /*drl handle structure invariant */
- /*@i222@*/
+ /* drl This is the code for structure invariants
+
+ It is no yet stable enough to be included in a Splint release.
+ */
+
/*check that we're in a structure */
-# if 0\r
+#if 0
/*@unused@*/ uentryList ueL;
/*@unused@*/ uentry ue2;
/*@unused@*/ ctype ct;\r
-# endif
+#endif
fileloc loc = fileloc_decColumn (g_currentloc, size_toInt (cstring_length (s)));
ret = sRef_undefined;
# if 0
- /*drl commenting this out for now
+
ct = context_getLastStruct ( ct );
llassert( ctype_isStruct(ct) );
return ret;
}
- */\r
-# endif\r
+
+#endif
voptgenerror
(FLG_UNRECOG,
ret->generatingExpr = c->generatingExpr;
/*@=assignexpose@*/
- /*@i33 fix this*/
if (c->orig != NULL)
ret->orig = constraint_copy (c->orig);
else
return ret;
}
-/*like copy expect it doesn't allocate memory for the constraint*/
+/*like copy except it doesn't allocate memory for the constraint*/
void constraint_overWrite (constraint c1, constraint c2)
{
else
c1->orig = NULL;
- /*@i33 make sure that the or is freed correctly*/
if (c1->or != NULL)
constraint_free (c1->or);
ret->ar = EQ;
ret->expr = constraintExpr_makeIntLiteral ((int)size);
ret->post = TRUE;
- /*@i1*/
return ret;
}
ret->ar = GTE;
ret->expr = constraintExpr_makeIntLiteral (ind);
ret->post = TRUE;
- /*@i1*/
return ret;
}
I'm a bit nervous about modifying the exprNode
but this is the easy way to do this
If I have time I'd like to cause the exprNode to get created correctly in the first place */
-/*@i223*/
void exprNode_findValue(exprNode e)
{
exprData data;
}
else if (*p == '0')
{
- /*@i3434*/
- /* drl: see if there is a reason that we shouldn't do
- p++;
- len--; */
-
base = 8;
}
else
exprNode_checkModify (e, ret);
/* added 7/11/2000 D.L */
- /*@i223*/
- /*DRL 6/8/01 I decided to disable all Splint warnings here since the code
- probably needs a rewrite any way */
-
/* updateEnvironmentForPostOp (e); */
idDecl_addClauses (idDecl d, functionClauseList clauses)
{
llassert (idDecl_isDefined (d));
- /*@i222*/
+
/*
+ DRL comment out llassert:
+
This breaks on sometypes of functionPointers.
I.e.
void (*signal (int sig ) @requires g >= 0 @ ) (int) @requires g >= 0 @ ;
{
case SK_RESULT:
{
- /* s = sRef_saveCopy(s); */ /*@i523@*/
ce = constraintExpr_makeTermsRef (s);
return ce;
}
{
sRef temp;
temp = (sRef_makePointer (sRef_fixBaseParam (s->info->ref, args)));
- /* temp = sRef_saveCopy(temp); */ /*@i523@*/
ce = constraintExpr_makeTermsRef (temp);
return ce;
}
s->kind = SK_ADR;
s->type = ctype_makePointer (t->type);
s->info = (sinfo) dmalloc (sizeof (*s->info));
- s->info->ref = t; /* sRef_copy (t); */ /*@i32@*/
+ s->info->ref = t;
if (t->defstate == SS_UNDEFINED)
/* no! it is allocated even still: && !ctype_isPointer (t->type)) */
ret->defstate = u->defstate;
ret->checked = u->checked;
- /*@i523 ret->origsref = sRef_copy (u->origsref); */
/* drl added 07-02-001 */
/* copy null terminated information */