about summary refs log tree commit diff homepage
path: root/lib/Core/Searcher.cpp
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2019-03-15 20:47:47 +0000
committerMartinNowack <martin.nowack@gmail.com>2019-03-16 21:23:24 +0000
commitc1d3977f07ddbf840ca3cdbd580239921a9c5f91 (patch)
tree92774b4a261228f4ae5523850a2efce122b00e6c /lib/Core/Searcher.cpp
parentd44d507631c345edf33ee7f6ecf7fd942af7760b (diff)
downloadklee-c1d3977f07ddbf840ca3cdbd580239921a9c5f91.tar.gz
Added support for disabling --batch-instructions and --batch-time by setting them to 0
Diffstat (limited to 'lib/Core/Searcher.cpp')
-rw-r--r--lib/Core/Searcher.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Core/Searcher.cpp b/lib/Core/Searcher.cpp
index db295468..47457a91 100644
--- a/lib/Core/Searcher.cpp
+++ b/lib/Core/Searcher.cpp
@@ -351,9 +351,11 @@ BatchingSearcher::~BatchingSearcher() {
 }
 
 ExecutionState &BatchingSearcher::selectState() {
-  if (!lastState || 
-      (time::getWallTime() - lastStartTime) > timeBudget ||
-      (stats::instructions - lastStartInstructions) > instructionBudget) {
+  if (!lastState ||
+      (((timeBudget.toSeconds() > 0) &&
+        (time::getWallTime() - lastStartTime) > timeBudget)) ||
+      ((instructionBudget > 0) &&
+       (stats::instructions - lastStartInstructions) > instructionBudget)) {
     if (lastState) {
       time::Span delta = time::getWallTime() - lastStartTime;
       auto t = timeBudget;