X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=execution.cc;h=a74147be4bbe7e068a9ddd05a58ff459ccb1a7c8;hb=3a4e118d45bf83a3b4c3a0a73d1071fa8fe5476d;hp=33c862bac36fd2a7e788cfae00a1a46a774ecd4a;hpb=f9e2e3a893918a431d3af1e6657cd08260e31941;p=model-checker.git diff --git a/execution.cc b/execution.cc index 33c862b..a74147b 100644 --- a/execution.cc +++ b/execution.cc @@ -366,7 +366,10 @@ ModelAction * ModelExecution::get_last_fence_conflict(ModelAction *act) const ModelAction * ModelExecution::get_last_conflict(ModelAction *act) const { switch (act->get_type()) { - /* case ATOMIC_FENCE: fences don't directly cause backtracking */ + case ATOMIC_FENCE: + /* Only seq-cst fences can (directly) cause backtracking */ + if (!act->is_seqcst()) + break; case ATOMIC_READ: case ATOMIC_WRITE: case ATOMIC_RMW: { @@ -377,6 +380,8 @@ ModelAction * ModelExecution::get_last_conflict(ModelAction *act) const action_list_t::reverse_iterator rit; for (rit = list->rbegin(); rit != list->rend(); rit++) { ModelAction *prev = *rit; + if (prev == act) + continue; if (prev->could_synchronize_with(act)) { ret = prev; break; @@ -1209,7 +1214,7 @@ bool ModelExecution::check_action_enabled(ModelAction *curr) { * * @param curr The current action to process * @return The ModelAction that is actually executed; may be different than - * curr; may be NULL, if the current action is not enabled to run + * curr */ ModelAction * ModelExecution::check_current_action(ModelAction *curr) {