**
*/
+static int inCompoundStatementExpression = 0;
+
+void
+exprChecks_inCompoundStatementExpression (void)
+{
+ inCompoundStatementExpression++;
+}
+
+void
+exprChecks_leaveCompoundStatementExpression (void)
+{
+ inCompoundStatementExpression--;
+ llassert (inCompoundStatementExpression >= 0);
+}
+
void
-exprNode_checkStatement (exprNode e)
+exprChecks_checkStatementEffect (exprNode e)
{
bool hasError = FALSE;
+ if (inCompoundStatementExpression > 0)
+ {
+ /*
+ ** Okay to have effectless statments in compound statement expression (should check
+ ** it is the last statement, but we don't for now).
+ */
+
+ return;
+ }
+
if (!exprNode_isError (e))
{
exprKind ek = e->kind;
/*drl modified */
-void exprNode_checkFunction (/*@unused@*/ uentry ue, /*@only@*/ exprNode fcnBody)
+void exprNode_checkFunction (/*@unused@*/ uentry ue, /*@only@*/ exprNode body)
{
constraintList c, t, post;
constraintList c2, fix;
constraintList implicitFcnConstraints;
-
- /*@owned@*/ exprNode body;
-
context_enterInnerContext ();
- body = fcnBody;
+ llassert (exprNode_isDefined (body));
/*
if we're not going to be printing any errors for buffer overflows
}
}
- exprNode_generateConstraints (body);
+ exprNode_generateConstraints (body); /* evans 2002-03-02: this should not be declared to take a
+ dependent... fix it! */
c = uentry_getFcnPreconditions (ue);
DPRINTF(("function constraints\n"));