From d02738576d6be6a387d1aaf903b98c94a0a329c6 Mon Sep 17 00:00:00 2001 From: Brian Demsky Date: Thu, 26 Dec 2019 00:02:34 -0800 Subject: [PATCH 1/1] Bug fix --- execution.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/execution.cc b/execution.cc index 1c03a97a..504f7f52 100644 --- a/execution.cc +++ b/execution.cc @@ -1773,7 +1773,17 @@ void ModelExecution::collectActions() { ModelAction *act = it->getVal(); //Do iteration early since we may delete node... it=it->getPrev(); + bool islastact = false; + ModelAction *lastact = get_last_action(act->get_tid()); + if (act == lastact) { + Thread * th = get_thread(act); + islastact = !th->is_complete(); + } + if (act->is_read()) { + if (islastact) { + act->set_read_from(NULL); + } if (act->get_reads_from()->is_free()) { removeAction(act); delete act; @@ -1788,6 +1798,10 @@ void ModelExecution::collectActions() { act->set_last_fence_release(NULL); } } + } + + if (islastact) { + continue; } else if (act->is_free()) { removeAction(act); delete act; @@ -1824,7 +1838,7 @@ void ModelExecution::collectActions() { delete act; } } else if (act->is_create()) { - if (act->get_thread_operand()->get_state()==THREAD_COMPLETED) { + if (act->get_thread_operand()->is_complete()) { removeAction(act); delete act; } -- 2.34.1