update FuncNodes when there is a write
authorweiyu <weiyuluo1232@gmail.com>
Thu, 22 Aug 2019 01:55:41 +0000 (18:55 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Thu, 22 Aug 2019 01:55:41 +0000 (18:55 -0700)
history.cc

index 68e8575fa25dadd204958dbbf5d61be239a58e67..581dfc1b57c6a0be5cf82e53656b97312c057e80 100644 (file)
@@ -125,8 +125,20 @@ void ModelHistory::process_action(ModelAction *act, thread_id_t tid)
        SnapList<action_list_t *> * func_act_lists = (*thrd_func_act_lists)[id];
 
        if (act->is_write()) {
-               add_to_write_history(act->get_location(), act->get_write_value());
-               
+               void * location = act->get_location();
+               uint64_t value = act->get_write_value();
+               add_to_write_history(location, value);
+
+               /* update FuncNodes */
+               SnapList<FuncNode *> * func_nodes = loc_func_nodes_map.get(location);
+               sllnode<FuncNode *> * it = NULL;
+               if (func_nodes != NULL)
+                       it = func_nodes->begin();
+
+               for (; it != NULL; it = it->getNext()) {
+                       FuncNode * func_node = it->getVal();
+                       func_node->add_to_val_loc_map(value, location);
+               }
        }
 
        /* the following does not care about actions without a position */