From: root Date: Wed, 31 Jul 2019 04:12:43 +0000 (-0700) Subject: bug fix X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bd4d831da77ae594a6790c4af7cb14abb022f80b;p=c11tester.git bug fix --- diff --git a/cmodelint.cc b/cmodelint.cc index b39e15b3..cbf21320 100644 --- a/cmodelint.cc +++ b/cmodelint.cc @@ -111,7 +111,11 @@ VOLATILELOAD(64) ensureModel(); \ model->switch_to_master(new ModelAction(ATOMIC_WRITE, position, memory_order_relaxed, obj, (uint64_t) val)); \ *((volatile uint ## size ## _t *)obj) = val; \ - } + thread_id_t tid = thread_current()->get_id(); \ + for(int i=0;i < size / 8;i++) { \ + recordWrite(tid, (void *)(((char *)obj)+i)); \ + } \ +} VOLATILESTORE(8) VOLATILESTORE(16) diff --git a/execution.cc b/execution.cc index 50e052a1..42968950 100644 --- a/execution.cc +++ b/execution.cc @@ -1161,11 +1161,11 @@ void ModelExecution::add_action_to_lists(ModelAction *act) void insertIntoActionList(action_list_t *list, ModelAction *act) { sllnode * rit = list->end(); modelclock_t next_seq = act->get_seq_number(); - if (rit == NULL || (rit->getVal())->get_seq_number() == next_seq) + if (rit == NULL || (rit->getVal()->get_seq_number() == next_seq)) list->push_back(act); else { for(;rit != NULL;rit=rit->getPrev()) { - if ((rit->getVal())->get_seq_number() == next_seq) { + if (rit->getVal()->get_seq_number() == next_seq) { list->insertAfter(rit, act); break; } @@ -1654,7 +1654,7 @@ Thread * ModelExecution::take_step(ModelAction *curr) ASSERT(curr); /* Process this action in ModelHistory for records*/ - model->get_history()->process_action( curr, curr->get_tid() ); + // model->get_history()->process_action( curr, curr->get_tid() ); if (curr_thrd->is_blocked() || curr_thrd->is_complete()) scheduler->remove_thread(curr_thrd); diff --git a/stl-model.h b/stl-model.h index 74aaee69..70490965 100644 --- a/stl-model.h +++ b/stl-model.h @@ -126,7 +126,7 @@ public: if (tail == node) { tail = node->prev; } else { - tail->next->prev = node->prev; + node->next->prev = node->prev; } mllnode<_Tp> *next = node->next; delete node; @@ -284,7 +284,7 @@ public: if (tail == node) { tail = node->prev; } else { - tail->next->prev = node->prev; + node->next->prev = node->prev; } sllnode<_Tp> *next = node->next; @@ -346,7 +346,7 @@ public: } type back() const { - return array[size - 1]; + return array[_size - 1]; } void resize(uint psize) {