diff options
author | Frank Busse <bb0xfb@gmail.com> | 2018-04-05 20:27:10 +0100 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2018-04-09 15:57:00 +0100 |
commit | a8bf1a78cd20d1c2608faeecc54369d95ceadde7 (patch) | |
tree | 0651f5c6674cd2036204404cf11a1eb4faa1bfe1 /lib/Core | |
parent | 110e97a4e07339cb9593a48b6a23df0f484a4750 (diff) | |
download | klee-a8bf1a78cd20d1c2608faeecc54369d95ceadde7.tar.gz |
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.
Diffstat (limited to 'lib/Core')
-rw-r--r-- | lib/Core/Executor.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
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<ExecutionState *>::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) { |