** constraintList.c
*/
+//#define DEBUGPRINT 1
+
# include <ctype.h> /* for isdigit */
# include "lclintMacros.nf"
# include "basic.h"
# include "exprNodeSList.h"
# include "exprData.i"
-# include "exprDataQuite.i"
+//# include "exprDataQuite.i"
+
+#ifndef exprNode_isError
+#warning wtf
+# define exprNode_isError(e) ((e) == exprNode_undefined)
+#else
+#warning strange
+#endif
+
+#define myexprNode_isError(e) ((e) == exprNode_undefined)
+
+
bool /*@alt void@*/ exprNode_generateConstraints (/*@temp@*/ exprNode e);
static bool exprNode_handleError( exprNode p_e);
constraintList constraintList_makeFixedArrayConstraints (sRefSet s);
constraintList checkCall (exprNode fcn, exprNodeList arglist);
+bool exprNode_testd()
+{
+ /* if ( ( (exprNode_isError ) ) )
+ {
+ }
+ if ( ( (e_1 ) ) )
+ {
+ }
+ */
+}
+
bool exprNode_isUnhandled (exprNode e)
{
llassert( exprNode_isDefined(e) );
if (exprNode_isUnhandled (e) )
{
DPRINTF( (message("Warning ignoring %s", exprNode_unparse (e) ) ) );
- e->requiresConstraints = constraintList_new();
- e->ensuresConstraints = constraintList_new();
- e->trueEnsuresConstraints = constraintList_new();
- e->falseEnsuresConstraints = constraintList_new();
- llassert(FALSE);
- return FALSE;
+ e->requiresConstraints = constraintList_new();
+ e->ensuresConstraints = constraintList_new();
+ e->trueEnsuresConstraints = constraintList_new();
+ e->falseEnsuresConstraints = constraintList_new();
+ // llassert(FALSE);
+ return FALSE;
}
{
return exprNode_multiStatement (e );
}
- // llassert(FALSE);
+ BPRINTF( (message ("Ignoring non-statement %s", exprNode_unparse(e) ) ) );
+ return TRUE;
+ // llassert(FALSE);
}
DPRINTF (("Stmt") );
sRefSet_elements (s, el)
{
- llassert (el);
+ // llassert (el);
if (sRef_isFixedArray(el) )
{
int s;
test = exprData_getTripleTest (forPred->edata);
inc = exprData_getTripleInc (forPred->edata);
+ // if ( ( (exprNode_isError (test) || (exprNode_isError(init) ) || (exprNode_isError) ) ) )
+ // if ( ( (myexprNode_isError (test) || (myexprNode_isError(init) ) || (myexprNode_isError) ) ) )
+
+ //if ( ( (exprNode_isError ) ) )
+ if ( ( (exprNode_isError (test) || (exprNode_isError(init) ) ) || (exprNode_isError (inc) ) ) )
+ {
+ BPRINTF ((message ("strange for statement:%s, ignoring it", exprNode_unparse(e) ) ) );
+ return ret;
+ }
+
test->trueEnsuresConstraints = exprNode_traversTrueEnsuresConstraints(test);
// e->requiresConstraints = reflectChanges (body->requiresConstraints, test->trueEnsuresConstraints);
e->requiresConstraints = reflectChanges (e->requiresConstraints, test->ensuresConstraints);
exprData data;
constraint cons;
- if (exprNode_handleError (e))
+ if (exprNode_isError(e) )
{
return FALSE;
}
e->trueEnsuresConstraints = constraintList_new();;
e->falseEnsuresConstraints = constraintList_new();;
+ if (exprNode_isUnhandled (e) )
+ {
+ return FALSE;
+ }
// e = makeDataTypeConstraints (e);
handledExprNode = TRUE;
lltok_unparse (exprData_getOpTok (data));
exprNode_exprTraverse (t2, definatelv, TRUE, sequencePoint );
- // DPRINTF ( ("Doing ASSign"));
- cons = constraint_makeEnsureEqual (t1, t2, sequencePoint);
+ /* this test is nessecary because some expressions generate a null expression node. function pointer do that -- drl */
+ if ( (!exprNode_isError (t1)) && (!exprNode_isError(t2)) )
+ {
+ cons = constraint_makeEnsureEqual (t1, t2, sequencePoint);
+ e->ensuresConstraints = constraintList_add(e->ensuresConstraints, cons);
+ }
- e->ensuresConstraints = constraintList_add(e->ensuresConstraints, cons);
-
break;
case XPR_OP:
t1 = exprData_getOpA (data);
return ret;
}
+
+#ifndef exprNode_isError
+#warning wtf
+# define exprNode_isError(e) ((e) == exprNode_undefined)
+#else
+#warning strange
+#endif