From: root Date: Mon, 30 Dec 2019 08:19:08 +0000 (-0800) Subject: bug fixes X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=938f4f938086a967e9cd101ecca164003f33f03c;hp=1b2222d691a55eb20b39d3804c71aca19f5577bf bug fixes --- diff --git a/action.h b/action.h index 1658a83d..66e11906 100644 --- a/action.h +++ b/action.h @@ -102,6 +102,7 @@ public: thread_id_t get_tid() const { return tid; } action_type get_type() const { return type; } + void set_type(action_type _type) { type = _type; } void set_free() { type = READY_FREE; } memory_order get_mo() const { return order; } memory_order get_original_mo() const { return original_order; } diff --git a/execution.cc b/execution.cc index e462748c..63c0ac7f 100644 --- a/execution.cc +++ b/execution.cc @@ -1779,8 +1779,10 @@ void ModelExecution::collectActions() { } } } - for (sllnode * it2 = action_trace.end();it2 != it;it2=it2->getPrev()) { + for (sllnode * it2 = action_trace.end();it2 != it;) { ModelAction *act = it2->getVal(); + //Do iteration early in case we delete the act + it2=it2->getPrev(); bool islastact = false; ModelAction *lastact = get_last_action(act->get_tid()); if (act == lastact) { @@ -1789,6 +1791,9 @@ void ModelExecution::collectActions() { } if (act->is_read() && act->get_reads_from()->is_free()) { + if (act->is_rmw()) { + act->set_type(ATOMIC_WRITE); + } removeAction(act); if (islastact) { fixupLastAct(act); @@ -1808,7 +1813,9 @@ void ModelExecution::collectActions() { } if (act->is_read()) { - if (act->get_reads_from()->is_free()) { + if (act->is_rmw()) { + act->set_type(ATOMIC_WRITE); + } else if (act->get_reads_from()->is_free()) { removeAction(act); if (islastact) { fixupLastAct(act);