model: simple ASSERT() bug
authorBrian Norris <banorris@uci.edu>
Thu, 13 Sep 2012 17:16:37 +0000 (10:16 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 13 Sep 2012 17:16:37 +0000 (10:16 -0700)
Don't ASSERT(rf->is_write()) until we're sure that rf is non-NULL.

model.cc

index 4475455..b566b62 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -781,11 +781,13 @@ bool ModelChecker::thin_air_constraint_may_allow(const ModelAction * writer, con
 bool ModelChecker::release_seq_head(const ModelAction *rf,
                 std::vector<const ModelAction *> *release_heads) const
 {
-       ASSERT(rf->is_write());
        if (!rf) {
                /* read from future: need to settle this later */
                return false; /* incomplete */
        }
+
+       ASSERT(rf->is_write());
+
        if (rf->is_release())
                release_heads->push_back(rf);
        if (rf->is_rmw()) {