From e4a2ca614279c8b6febe35edf169eb38c0d85178 Mon Sep 17 00:00:00 2001 From: Adrian Herrera Date: Tue, 14 Apr 2020 13:27:29 +1000 Subject: StatsTracker: initialize indexed stats when user searcher requires MD2U This is the same check used in Executor::setModule. Without this check, KLEE will segfault in StatisticsManager::incrementIndexedValue, getIndexedValue, and setIndexedValue when `-output-stats=false` or `-output-istats=false` because StatisticsManager::indexedStats has not been allocated. --- lib/Core/StatsTracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp index 395babf0..4b4dc47c 100644 --- a/lib/Core/StatsTracker.cpp +++ b/lib/Core/StatsTracker.cpp @@ -195,7 +195,7 @@ StatsTracker::StatsTracker(Executor &_executor, std::string _objectFilename, } } - if (OutputIStats) + if (useStatistics() || userSearcherRequiresMD2U()) theStatisticManager->useIndexedStats(km->infos->getMaxID()); for (auto &kfp : km->functions) { -- cgit 1.4.1