cyclegraph: add non-NULL assertions
[model-checker.git] / cyclegraph.cc
index 967b0763abbdcdba0ec35cdd2608cb0fa94caa13..9256deb936be5ae69cb376efc60e7ced207222b5 100644 (file)
@@ -1,5 +1,6 @@
 #include "cyclegraph.h"
 #include "action.h"
+#include "common.h"
 
 /** Initializes a CycleGraph object. */
 CycleGraph::CycleGraph() :
@@ -33,6 +34,9 @@ CycleNode * CycleGraph::getNode(const ModelAction *action) {
  * @param from The edge comes from this ModelAction
  */
 void CycleGraph::addEdge(const ModelAction *from, const ModelAction *to) {
+       ASSERT(from);
+       ASSERT(to);
+
        CycleNode *fromnode=getNode(from);
        CycleNode *tonode=getNode(to);
 
@@ -65,6 +69,9 @@ void CycleGraph::addEdge(const ModelAction *from, const ModelAction *to) {
  *  action can read from a given write.
  */
 void CycleGraph::addRMWEdge(const ModelAction *from, const ModelAction *rmw) {
+       ASSERT(from);
+       ASSERT(rmw);
+
        CycleNode *fromnode=getNode(from);
        CycleNode *rmwnode=getNode(rmw);