From fd1c312226f7619db525c7d88c627df55d90cbc2 Mon Sep 17 00:00:00 2001 From: weiyu Date: Thu, 29 Aug 2019 16:02:17 -0700 Subject: [PATCH] fix bug by changing MEMALLOC to SNAPSHOTALLOC --- fuzzer.h | 2 +- newfuzzer.cc | 5 ++--- newfuzzer.h | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fuzzer.h b/fuzzer.h index 56e40a98..348225c8 100644 --- a/fuzzer.h +++ b/fuzzer.h @@ -15,7 +15,7 @@ public: bool shouldSleep(const ModelAction *sleep); bool shouldWake(const ModelAction *sleep); virtual void register_engine(ModelHistory * history, ModelExecution * execution) = 0; - MEMALLOC + SNAPSHOTALLOC private: }; #endif diff --git a/newfuzzer.cc b/newfuzzer.cc index 3cc3f604..e09175ce 100644 --- a/newfuzzer.cc +++ b/newfuzzer.cc @@ -120,8 +120,6 @@ bool NewFuzzer::prune_writes(thread_id_t tid, Predicate * pred, return false; int thread_id = id_to_int(tid); - bool pruned = false; - uint old_size = thrd_pruned_writes.size(); if (thrd_pruned_writes.size() <= (uint) thread_id) { uint new_size = thread_id + 1; @@ -132,6 +130,7 @@ bool NewFuzzer::prune_writes(thread_id_t tid, Predicate * pred, SnapVector * pruned_writes = thrd_pruned_writes[thread_id]; pruned_writes->clear(); // clear the old pruned_writes set + bool pruned = false; uint index = 0; while ( index < rf_set->size() ) { ModelAction * write_act = (*rf_set)[index]; @@ -143,7 +142,7 @@ bool NewFuzzer::prune_writes(thread_id_t tid, Predicate * pred, uint64_t write_val = write_act->get_write_value(); bool equality; - // No predicate, return everything in the rf_set + // No predicate, return false if (expression->token == NOPREDICATE) return pruned; diff --git a/newfuzzer.h b/newfuzzer.h index 1973cb4a..c956935e 100644 --- a/newfuzzer.h +++ b/newfuzzer.h @@ -23,7 +23,7 @@ public: void register_engine(ModelHistory * history, ModelExecution * execution); - MEMALLOC + SNAPSHOTALLOC private: ModelHistory * history; ModelExecution * execution; @@ -31,7 +31,7 @@ private: SnapVector thrd_last_read_act; SnapVector thrd_curr_pred; SnapVector thrd_selected_child_branch; - SnapVector< SnapVector * > thrd_pruned_writes; + SnapVector< SnapVector *> thrd_pruned_writes; }; #endif /* end of __NEWFUZZER_H__ */ -- 2.34.1