bug fix
authorroot <root@dw-6.eecs.uci.edu>
Wed, 31 Jul 2019 04:12:43 +0000 (21:12 -0700)
committerroot <root@dw-6.eecs.uci.edu>
Wed, 31 Jul 2019 04:12:43 +0000 (21:12 -0700)
cmodelint.cc
execution.cc
stl-model.h

index b39e15b31e4ca7dfc27c870c9145bc1526aceee7..cbf21320a52b6fd0792298bdfb15492d7464e83a 100644 (file)
@@ -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)
index 50e052a14ebd147d1739d5ca2735c5d500122502..4296895014c3eaa3c806067475a5a5cee6b3c16c 100644 (file)
@@ -1161,11 +1161,11 @@ void ModelExecution::add_action_to_lists(ModelAction *act)
 void insertIntoActionList(action_list_t *list, ModelAction *act) {
        sllnode<ModelAction*> * 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);
index 74aaee698f0d9a05e74b030cf0e4cb285bc2fe12..70490965a2c70404eaf94a42ddc715777772f20d 100644 (file)
@@ -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) {