From 421319a2cca7e57e5479113dadf13ea6115d37fd Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Fri, 24 Mar 2023 12:59:31 +0000 Subject: use unique_ptr in CexCachingSolver --- lib/Solver/CexCachingSolver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Solver') 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 + using namespace klee; using namespace llvm; @@ -66,7 +68,7 @@ struct AssignmentLessThan { class CexCachingSolver : public SolverImpl { typedef std::set assignmentsTable_ty; - Solver *solver; + std::unique_ptr solver; MapOfSets, 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; -- cgit 1.4.1