From a8bf1a78cd20d1c2608faeecc54369d95ceadde7 Mon Sep 17 00:00:00 2001 From: Frank Busse Date: Thu, 5 Apr 2018 20:27:10 +0100 Subject: doDumpStates: incorrectly increments stats doDumpStates calls stepInstruction and therefore indirectly increases time and instruction statistics for all dangling (dumped) states. This patch removes the call, but now the timing stats for the last executed state are lost, as StatsTracker::stepInstruction isn't called anymore. --- lib/Core/Executor.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/Core/Executor.cpp') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 1ab82595..794b5980 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -2577,15 +2577,11 @@ void Executor::checkMemoryUsage() { void Executor::doDumpStates() { if (!DumpStatesOnHalt || states.empty()) return; + klee_message("halting execution, dumping remaining states"); - for (std::set::iterator it = states.begin(), - ie = states.end(); - it != ie; ++it) { - ExecutionState &state = **it; - stepInstruction(state); // keep stats rolling - terminateStateEarly(state, "Execution halting."); - } - updateStates(0); + for (const auto &state : states) + terminateStateEarly(*state, "Execution halting."); + updateStates(nullptr); } void Executor::run(ExecutionState &initialState) { -- cgit 1.4.1