fix edge case
[c11tester.git] / action.cc
index 814c7fb1be0f05df2e42725ef6fb7cd86c641b1c..d65695446486e58a929196335660d8c3172cb94d 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -48,7 +48,7 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc,
        seq_number(ACTION_INITIAL_CLOCK)
 {
        /* References to NULL atomic variables can end up here */
-       ASSERT(loc || type == ATOMIC_FENCE);
+       ASSERT(loc || type == ATOMIC_FENCE || type == ATOMIC_NOP);
 
        Thread *t = thread ? thread : thread_current();
        this->tid = t!= NULL ? t->get_id() : -1;
@@ -305,6 +305,11 @@ bool ModelAction::is_write() const
        return type == ATOMIC_WRITE || type == ATOMIC_RMW || type == ATOMIC_INIT || type == NONATOMIC_WRITE;
 }
 
+bool ModelAction::is_create() const
+{
+       return type == THREAD_CREATE || type == PTHREAD_CREATE;
+}
+
 bool ModelAction::is_free() const
 {
        return type == READY_FREE;