fix bug by changing MEMALLOC to SNAPSHOTALLOC
authorweiyu <weiyuluo1232@gmail.com>
Thu, 29 Aug 2019 23:02:17 +0000 (16:02 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Thu, 29 Aug 2019 23:02:17 +0000 (16:02 -0700)
fuzzer.h
newfuzzer.cc
newfuzzer.h

index 56e40a984c8eaeeacefae1b352610edb0f9b876d..348225c8f60184d90701b63df36767761bf0129e 100644 (file)
--- 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
index 3cc3f6041abaf33416d1a147a05d63901d33d7ba..e09175ce227ce1e17f87204ad08a686c743e1d1b 100644 (file)
@@ -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<ModelAction *> * 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;
 
index 1973cb4a4e30ec2131e0e39544fea0c6d82585d8..c956935e8cef70b354302e83449722148a34bc31 100644 (file)
@@ -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<ModelAction *> thrd_last_read_act;
        SnapVector<Predicate *> thrd_curr_pred;
        SnapVector<Predicate *> thrd_selected_child_branch;
-       SnapVector< SnapVector<ModelAction *> * > thrd_pruned_writes;
+       SnapVector< SnapVector<ModelAction *> *> thrd_pruned_writes;
 };
 
 #endif /* end of __NEWFUZZER_H__ */