From 3ca81c2dc3881aec0bbf94646c73a148d706c76d Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Sun, 29 Oct 2023 16:00:02 +0000 Subject: Change `GetConstraintLog` to work with `std::string`s instead of `char*`s --- lib/Solver/MetaSMTSolver.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/Solver/MetaSMTSolver.cpp') diff --git a/lib/Solver/MetaSMTSolver.cpp b/lib/Solver/MetaSMTSolver.cpp index c3c6dfaa..197b89c3 100644 --- a/lib/Solver/MetaSMTSolver.cpp +++ b/lib/Solver/MetaSMTSolver.cpp @@ -88,7 +88,7 @@ public: MetaSMTSolverImpl(MetaSMTSolver *solver, bool useForked, bool optimizeDivides); - char *getConstraintLog(const Query &); + std::string getConstraintLog(const Query &) override; void setCoreSolverTimeout(time::Span timeout) { _timeout = timeout; } bool computeTruth(const Query &, bool &isValid); @@ -135,11 +135,8 @@ MetaSMTSolverImpl::MetaSMTSolverImpl( } template -char *MetaSMTSolverImpl::getConstraintLog(const Query &) { - const char *msg = "Not supported"; - char *buf = new char[strlen(msg) + 1]; - strcpy(buf, msg); - return buf; +std::string MetaSMTSolverImpl::getConstraintLog(const Query &) { + return {"Not supported"}; } template @@ -409,7 +406,7 @@ template MetaSMTSolver::~MetaSMTSolver() {} template -char *MetaSMTSolver::getConstraintLog(const Query &query) { +std::string MetaSMTSolver::getConstraintLog(const Query &query) { return impl->getConstraintLog(query); } -- cgit 1.4.1