From 7ecb1872e35ceba59b6949aa3942521e01920bd6 Mon Sep 17 00:00:00 2001 From: weiyu Date: Fri, 9 Aug 2019 13:09:46 -0700 Subject: [PATCH] fix bug - 'backedge' in predicate.cc uninitialized --- funcnode.cc | 8 +++----- funcnode.h | 1 - predicate.cc | 3 ++- predicate.h | 2 ++ 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/funcnode.cc b/funcnode.cc index d60fbe1c..7daf921d 100644 --- a/funcnode.cc +++ b/funcnode.cc @@ -7,8 +7,7 @@ FuncNode::FuncNode() : 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 @@ -225,7 +224,6 @@ void FuncNode::update_predicate_tree(action_list_t * act_list, HashTablesize() == 0) return; - /* if (predicate_tree_initialized) { return; @@ -299,8 +297,8 @@ void FuncNode::update_predicate_tree(action_list_t * act_list, HashTablegetNext(); } - 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 diff --git a/funcnode.h b/funcnode.h index 62a3bc50..4fcbb940 100644 --- a/funcnode.h +++ b/funcnode.h @@ -62,7 +62,6 @@ private: /* Store the values read by atomic read actions per memory location for each thread */ ModelVector thrd_read_map; - HashTable predicate_tree_backedges; }; #endif /* __FUNCNODE_H__ */ diff --git a/predicate.cc b/predicate.cc index 6b83d225..77f362da 100644 --- a/predicate.cc +++ b/predicate.cc @@ -5,7 +5,8 @@ Predicate::Predicate(FuncInst * func_inst, bool is_entry) : entry_predicate(is_entry), pred_expressions(), children(), - parents() + parents(), + backedge(NULL) {} unsigned int pred_expr_hash(struct pred_expr * expr) diff --git a/predicate.h b/predicate.h index c4390f11..2f15a126 100644 --- a/predicate.h +++ b/predicate.h @@ -58,10 +58,12 @@ public: private: FuncInst * func_inst; bool entry_predicate; + /* may have multiple predicates */ PredExprSet pred_expressions; ModelVector children; ModelVector parents; + /* assume almost one back edge exists */ Predicate * backedge; }; -- 2.34.1