bug fix
[c11tester.git] / execution.cc
index ac3ecbc00e069abd7a53ebbf8d6d70168bf14c97..290a2624666f905dc8bac06c5178aafc2fe5dda0 100644 (file)
@@ -919,6 +919,8 @@ void ModelExecution::w_modification_order(ModelAction *curr)
                if (last_seq_cst != NULL) {
                        edgeset.push_back(last_seq_cst);
                }
+               //update map for next query
+               obj_last_sc_map.put(curr->get_location(), curr);
        }
 
        /* Last SC fence in the current thread */
@@ -979,7 +981,7 @@ void ModelExecution::w_modification_order(ModelAction *curr)
                                        edgeset.push_back(act);
                                else if (act->is_read()) {
                                        //if previous read accessed a null, just keep going
-                                       edgeset.push_back(act);
+                                       edgeset.push_back(act->get_reads_from());
                                }
                                break;
                        }
@@ -1207,10 +1209,6 @@ void ModelExecution::add_normal_write_to_lists(ModelAction *act)
 
 
 void ModelExecution::add_write_to_lists(ModelAction *write) {
-       // Update seq_cst map
-       if (write->is_seqcst())
-               obj_last_sc_map.put(write->get_location(), write);
-
        SnapVector<action_list_t> *vec = get_safe_ptr_vect_action(&obj_wr_thrd_map, write->get_location());
        int tid = id_to_int(write->get_tid());
        if (tid >= (int)vec->size())