+ // The chosen branch fails, reselect new branches
+ while ( rf_set->size() == 0 ) {
+ Predicate * selected_branch = get_selected_child_branch(tid);
+ FuncNode * func_node = history->get_curr_func_node(tid);
+
+ // Add failed predicate to NewFuzzer and FuncNode
+ failed_predicates.put(selected_branch, true);
+ func_node->add_failed_predicate(selected_branch);
+ selected_branch->incr_fail_count();
+
+ //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());
+
+ SnapVector<ModelAction *> * pruned_writes = thrd_pruned_writes[thread_id];
+ for (uint i = 0;i < pruned_writes->size();i++) {
+ rf_set->push_back( (*pruned_writes)[i] );
+ }
+
+ // Reselect a predicate and prune writes
+ Predicate * curr_pred = selected_branch->get_parent();
+ FuncInst * read_inst = thrd_last_func_inst[thread_id];
+ selected_branch = selectBranch(tid, curr_pred, read_inst);
+
+ inst_act_map_t * inst_act_map = func_node->get_inst_act_map(tid);
+ prune_writes(tid, selected_branch, rf_set, inst_act_map);
+
+ ASSERT(selected_branch);
+ }
+