From 807bb2d23b9391338ab395bfe0005b378d9026ac Mon Sep 17 00:00:00 2001 From: weiyu Date: Tue, 18 Feb 2020 16:56:59 -0800 Subject: [PATCH] Add failed predicates to predicate trace; remove unused codes --- history.cc | 15 --------------- newfuzzer.cc | 1 + predicate.cc | 19 ------------------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/history.cc b/history.cc index 7fab503b..19354d74 100644 --- a/history.cc +++ b/history.cc @@ -147,21 +147,6 @@ void ModelHistory::process_action(ModelAction *act, thread_id_t tid) FuncNode * func_node = func_nodes[func_id]; func_node->add_inst(act); - if (act->is_read()) { - // Do nothing - } else if (act->is_write()) { - /* - Predicate * curr_pred = func_node->get_predicate_tree_position(tid); - FuncInst * curr_inst = func_node->get_inst(act); - - if (curr_pred) { - // Follow child - curr_pred = curr_pred->follow_write_child(curr_inst); - } - func_node->set_predicate_tree_position(tid, curr_pred); - */ - } - func_node->update_tree(act); last_action = act; } diff --git a/newfuzzer.cc b/newfuzzer.cc index be483886..da10e864 100644 --- a/newfuzzer.cc +++ b/newfuzzer.cc @@ -91,6 +91,7 @@ int NewFuzzer::selectWrite(ModelAction *read, SnapVector * rf_set // Increment failure count selected_branch->incr_fail_count(); + func_node->add_predicate_to_trace(tid, selected_branch); // For updating predicate weight //model_print("the %d read action of thread %d at %p is unsuccessful\n", read->get_seq_number(), read_thread->get_id(), read->get_location()); diff --git a/predicate.cc b/predicate.cc index 9b329f10..0028cf17 100644 --- a/predicate.cc +++ b/predicate.cc @@ -80,25 +80,6 @@ void Predicate::copy_predicate_expr(Predicate * other) delete it; } -/* Follow the child if any child whose FuncInst matches with inst - * - * @param inst must be an ATOMIC_WRITE FuncInst - * @return NULL if no such child is found. - */ -Predicate * Predicate::follow_write_child(FuncInst * inst) -{ - action_type type = inst->get_type(); - ASSERT(type == ATOMIC_WRITE || type == ATOMIC_INIT); - - for (uint i = 0;i < children.size();i++) { - Predicate * child = children[i]; - if (child->get_func_inst() == inst) - return child; - } - - return NULL; -} - /* Evaluate predicate expressions against the given inst_act_map */ ConcretePredicate * Predicate::evaluate(thread_id_t tid) { -- 2.34.1