From 4ccb3fe8df5babec7480b433b38da265de73a8eb Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Fri, 24 Mar 2023 00:49:50 +0000 Subject: use unique_ptr in STPSolverImpl --- lib/Solver/STPSolver.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/Solver/STPSolver.cpp b/lib/Solver/STPSolver.cpp index 6e62b82b..140ca6f4 100644 --- a/lib/Solver/STPSolver.cpp +++ b/lib/Solver/STPSolver.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -85,7 +86,7 @@ namespace klee { class STPSolverImpl : public SolverImpl { private: VC vc; - STPBuilder *builder; + std::unique_ptr builder; time::Span timeout; bool useForkedSTP; SolverRunStatus runStatusCode; @@ -187,7 +188,7 @@ STPSolverImpl::~STPSolverImpl() { shared_memory_ptr = nullptr; shared_memory_id = 0; - delete builder; + builder.reset(); vc_Destroy(vc); } @@ -402,13 +403,13 @@ bool STPSolverImpl::computeInitialValues( bool success; if (useForkedSTP) { - runStatusCode = runAndGetCexForked(vc, builder, stp_e, objects, values, - hasSolution, timeout); + runStatusCode = runAndGetCexForked(vc, builder.get(), stp_e, objects, + values, hasSolution, timeout); success = ((SOLVER_RUN_STATUS_SUCCESS_SOLVABLE == runStatusCode) || (SOLVER_RUN_STATUS_SUCCESS_UNSOLVABLE == runStatusCode)); } else { runStatusCode = - runAndGetCex(vc, builder, stp_e, objects, values, hasSolution); + runAndGetCex(vc, builder.get(), stp_e, objects, values, hasSolution); success = true; } -- cgit 1.4.1