From 661fba88fff0205ea258a1149907f2822458cd83 Mon Sep 17 00:00:00 2001 From: Frank Busse Date: Thu, 25 Jun 2020 21:35:25 +0100 Subject: introduce --rng-initial-seed= * move global theRNG into Executor * pass theRNG via ctor to searchers * remove some type warnings from RNG.cpp Fixes #1023. --- lib/Core/Searcher.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/Core/Searcher.h') diff --git a/lib/Core/Searcher.h b/lib/Core/Searcher.h index baeafd84..fa0440b8 100644 --- a/lib/Core/Searcher.h +++ b/lib/Core/Searcher.h @@ -11,6 +11,7 @@ #define KLEE_SEARCHER_H #include "PTree.h" +#include "klee/ADT/RNG.h" #include "klee/System/Time.h" #include "llvm/Support/CommandLine.h" @@ -116,8 +117,10 @@ namespace klee { class RandomSearcher : public Searcher { std::vector states; + RNG &theRNG; public: + explicit RandomSearcher(RNG &rng) : theRNG{rng} {} ExecutionState &selectState(); void update(ExecutionState *current, const std::vector &addedStates, @@ -142,13 +145,14 @@ namespace klee { private: DiscretePDF *states; + RNG &theRNG; WeightType type; bool updateWeights; double getWeight(ExecutionState*); public: - WeightedRandomSearcher(WeightType type); + WeightedRandomSearcher(WeightType type, RNG &rng); ~WeightedRandomSearcher(); ExecutionState &selectState(); @@ -191,12 +195,13 @@ namespace klee { */ class RandomPathSearcher : public Searcher { PTree &processTree; + RNG &theRNG; // Unique bitmask of this searcher const uint8_t idBitMask; public: - RandomPathSearcher(PTree &processTree); + RandomPathSearcher(PTree &processTree, RNG &rng); ~RandomPathSearcher(); ExecutionState &selectState(); -- cgit 1.4.1