** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
** MA 02111-1307, USA.
**
-** For information on splint: splint@cs.virginia.edu
-** To report a bug: splint-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
*/
static bool exprNode_handleError(/*@dependent@*/ exprNode p_e);
+static void exprNode_stmt ( /*@dependent@*/ /*@temp@*/ exprNode p_e);
+
static bool exprNode_isMultiStatement(/*@dependent@*/ exprNode p_e);
static void exprNode_multiStatement (/*@dependent@*/ exprNode p_e);
if (exprNode_isUnhandled (e) )
{
DPRINTF((message("Warning ignoring %s", exprNode_unparse (e) ) ) );
- return FALSE;
+ return FALSE;
}
DPRINTF((message ("exprNode_generateConstraints Analysising %s at %s", exprNode_unparse( e),
}
else
{
- fileloc loc;
+/* fileloc loc; */
- loc = exprNode_getNextSequencePoint(e);
- exprNode_exprTraverse(e, FALSE, FALSE, loc);
+/* loc = exprNode_getNextSequencePoint(e); */
+/* exprNode_exprTraverse(e, FALSE, FALSE, loc); */
- fileloc_free(loc);
+/* fileloc_free(loc); */
+
+ exprNode_stmt(e);
return FALSE;
+
}
{
constraintList_free(tempList);
return;
}
+
+ /*drl 2/13/002 patched bug so return statement will be checked*/
+ /*return is a stmt not not expression ...*/
+ if (e->kind == XPR_RETURN)
+ {
+ constraintList tempList;
+
+ loc = exprNode_getNextSequencePoint(e); /* reduces to an expression */
+
+ exprNode_exprTraverse (exprData_getSingle (e->edata), FALSE, TRUE, loc);
+ fileloc_free(loc);
+
+ tempList = e->requiresConstraints;
+ e->requiresConstraints = exprNode_traversRequiresConstraints(e);
+ constraintList_free(tempList);
+ }
if (e->kind != XPR_STMT)
{
{
exprNode_multiStatement (e); /* evans 2001-08-21: spurious return removed */
}
-
- DPRINTF((message ("Ignoring non-statement %s", exprNode_unparse(e) ) ) );
- return;
+ else
+ {
+ loc = exprNode_getNextSequencePoint(e); /* reduces to an expression */
+
+ exprNode_exprTraverse (e, FALSE, TRUE, loc);
+ fileloc_free(loc);
+
+ }
+ return;
}
DPRINTF (("Stmt") );
return postconditions;
}
+/*
+comment this out for now
+we'll include it in a production release when its stable...
+
+ void findStructs ( exprNodeList arglist)
+{
+
+ ctype ct, rt;
+
+ DPRINTF((
+ message("doing findStructs: %s", exprNodeList_unparse(arglist) )
+ ));
+
+
+ exprNodeList_elements(arglist, expr)
+ {
+ ct = exprNode_getType(expr);
+
+ rt = ctype_realType (ct);
+
+ if ( ctype_isStruct (rt ) )
+ TPRINTF(( message("Found structure %s", exprNode_unparse(expr) )
+ ));
+ if (hasInvariants(ct) )
+ {
+ constraintList invars;
+
+ invars = getInvariants(ct);
+
+
+ TPRINTF(( message ("findStructs has invariants %s ", constraintList_print (invars) )
+ ));
+
+ invars = constraintList_doSRefFixStructConstraint(invars, exprNode_getSref(expr), ct );
+
+
+ TPRINTF(( message ("findStructs finded invariants to be %s ", constraintList_print (invars) )
+ ));
+ }
+ }
+ end_exprNodeList_elements;
+}
+
+*/
/*drl moved out of constraintResolve.c 07-02-001 */
constraintList checkCall (/*@dependent@*/ exprNode fcn, exprNodeList arglist)
}
DPRINTF (( message("Done checkCall\n") ));
DPRINTF (( message("Returning list %q ", constraintList_printDetailed(preconditions) ) ));
+
+ /*
+ drl we're going to comment this out for now
+ we'll include it if we're sure it's working
+
+ findStructs(arglist);
+ */
+
return preconditions;
}