From: Brian Norris Date: Wed, 12 Sep 2012 00:54:29 +0000 (-0700) Subject: cyclegraph: add non-NULL assertions X-Git-Tag: pldi2013~222 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=ae25995a404cb06c3e89dd878c7abd763449cdb3 cyclegraph: add non-NULL assertions --- diff --git a/cyclegraph.cc b/cyclegraph.cc index 967b076..9256deb 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -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);