X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=clockvector.cc;h=2336df2f4720f6bea613891859591ddf47488fc3;hp=c86995bc9bbb555cf9e2381d1b7df91036330a46;hb=dc8e9b89ec62b6da4816ec4e31fe2971cbcdcb54;hpb=368dcf3baf2ef233bc752474d23bea77f22b2edd diff --git a/clockvector.cc b/clockvector.cc index c86995bc..2336df2f 100644 --- a/clockvector.cc +++ b/clockvector.cc @@ -18,8 +18,7 @@ */ ClockVector::ClockVector(ClockVector *parent, const ModelAction *act) { - ASSERT(act); - num_threads = int_to_id(act->get_tid()) + 1; + num_threads = act != NULL ? int_to_id(act->get_tid()) + 1 : 0; if (parent && parent->num_threads > num_threads) num_threads = parent->num_threads; @@ -27,7 +26,8 @@ ClockVector::ClockVector(ClockVector *parent, const ModelAction *act) if (parent) std::memcpy(clock, parent->clock, parent->num_threads * sizeof(modelclock_t)); - clock[id_to_int(act->get_tid())] = act->get_seq_number(); + if (act != NULL) + clock[id_to_int(act->get_tid())] = act->get_seq_number(); } /** @brief Destructor */