about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorDaniel Schemmel <daniel@schemmel.net>2023-03-24 12:59:31 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-04-21 13:07:31 +0100
commit421319a2cca7e57e5479113dadf13ea6115d37fd (patch)
tree22a1d6de043b461a8a83a28231ab333a83c5106f /lib
parentae0fd16356a7e421e10ffc4e8701583f012b4516 (diff)
downloadklee-421319a2cca7e57e5479113dadf13ea6115d37fd.tar.gz
use unique_ptr in CexCachingSolver
Diffstat (limited to 'lib')
-rw-r--r--lib/Solver/CexCachingSolver.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Solver/CexCachingSolver.cpp b/lib/Solver/CexCachingSolver.cpp
index 45ec5540..28996a6a 100644
--- a/lib/Solver/CexCachingSolver.cpp
+++ b/lib/Solver/CexCachingSolver.cpp
@@ -23,6 +23,8 @@
 
 #include "llvm/Support/CommandLine.h"
 
+#include <memory>
+
 using namespace klee;
 using namespace llvm;
 
@@ -66,7 +68,7 @@ struct AssignmentLessThan {
 class CexCachingSolver : public SolverImpl {
   typedef std::set<Assignment*, AssignmentLessThan> assignmentsTable_ty;
 
-  Solver *solver;
+  std::unique_ptr<Solver> solver;
   
   MapOfSets<ref<Expr>, Assignment*> cache;
   // memo table
@@ -265,7 +267,6 @@ bool CexCachingSolver::getAssignment(const Query& query, Assignment *&result) {
 
 CexCachingSolver::~CexCachingSolver() {
   cache.clear();
-  delete solver;
   for (assignmentsTable_ty::iterator it = assignmentsTable.begin(), 
          ie = assignmentsTable.end(); it != ie; ++it)
     delete *it;