fix bug - 'backedge' in predicate.cc uninitialized
authorweiyu <weiyuluo1232@gmail.com>
Fri, 9 Aug 2019 20:09:46 +0000 (13:09 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Fri, 9 Aug 2019 20:09:46 +0000 (13:09 -0700)
funcnode.cc
funcnode.h
predicate.cc
predicate.h

index d60fbe1c9a65b5762cf25b4507ef25f6f80fe3e0..7daf921d785add23e69e4ed94a22ae26b62696ca 100644 (file)
@@ -7,8 +7,7 @@ FuncNode::FuncNode() :
        func_inst_map(),
        inst_list(),
        entry_insts(),
        func_inst_map(),
        inst_list(),
        entry_insts(),
-       thrd_read_map(),
-       predicate_tree_backedges()
+       thrd_read_map()
 {}
 
 /* Check whether FuncInst with the same type, position, and location
 {}
 
 /* Check whether FuncInst with the same type, position, and location
@@ -225,7 +224,6 @@ void FuncNode::update_predicate_tree(action_list_t * act_list, HashTable<ModelAc
 {
        if (act_list == NULL || act_list->size() == 0)
                return;
 {
        if (act_list == NULL || act_list->size() == 0)
                return;
-
 /*
        if (predicate_tree_initialized) {
                return;
 /*
        if (predicate_tree_initialized) {
                return;
@@ -299,8 +297,8 @@ void FuncNode::update_predicate_tree(action_list_t * act_list, HashTable<ModelAc
                it = it->getNext();
        }
 
                it = it->getNext();
        }
 
-       model_print("function %s\n", func_name);
-       print_predicate_tree();
+//     model_print("function %s\n", func_name);
+//     print_predicate_tree();
 }
 
 /* Given curr_pred and next_inst, find the branch following curr_pred that contains next_inst and the correct predicate
 }
 
 /* Given curr_pred and next_inst, find the branch following curr_pred that contains next_inst and the correct predicate
index 62a3bc504d4fd7d18438a4b4093d080b76401480..4fcbb94050051ebf7e38a18d9932bd29c99a4a96 100644 (file)
@@ -62,7 +62,6 @@ private:
 
        /* Store the values read by atomic read actions per memory location for each thread */
        ModelVector<read_map_t *> thrd_read_map;
 
        /* Store the values read by atomic read actions per memory location for each thread */
        ModelVector<read_map_t *> thrd_read_map;
-       HashTable<FuncInst *, Predicate *, uintptr_t, 0, model_malloc, model_calloc, model_free> predicate_tree_backedges;
 };
 
 #endif /* __FUNCNODE_H__ */
 };
 
 #endif /* __FUNCNODE_H__ */
index 6b83d2254df38c35094de62680b133462543aaca..77f362dafd9c4f8ea29e465a3c01f5f99ea9172c 100644 (file)
@@ -5,7 +5,8 @@ Predicate::Predicate(FuncInst * func_inst, bool is_entry) :
        entry_predicate(is_entry),
        pred_expressions(),
        children(),
        entry_predicate(is_entry),
        pred_expressions(),
        children(),
-       parents()
+       parents(),
+       backedge(NULL)
 {}
 
 unsigned int pred_expr_hash(struct pred_expr * expr)
 {}
 
 unsigned int pred_expr_hash(struct pred_expr * expr)
index c4390f11f33b0d4da8e808bc363c073c9571e44c..2f15a126653f724e510c3c7a1fb0145fe781a1cd 100644 (file)
@@ -58,10 +58,12 @@ public:
 private:
        FuncInst * func_inst;
        bool entry_predicate;
 private:
        FuncInst * func_inst;
        bool entry_predicate;
+
        /* may have multiple predicates */
        PredExprSet pred_expressions;
        ModelVector<Predicate *> children;
        ModelVector<Predicate *> parents;
        /* may have multiple predicates */
        PredExprSet pred_expressions;
        ModelVector<Predicate *> children;
        ModelVector<Predicate *> parents;
+
        /* assume almost one back edge exists */
        Predicate * backedge;
 };
        /* assume almost one back edge exists */
        Predicate * backedge;
 };