about summary refs log tree commit diff homepage
path: root/lib/Core
diff options
context:
space:
mode:
authorDaniel Schemmel <daniel@schemmel.net>2023-10-29 16:00:02 +0000
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2024-01-30 21:40:32 +0000
commit3ca81c2dc3881aec0bbf94646c73a148d706c76d (patch)
tree27852ee64e2148b2225f7d4dfd4e33b244be4cfd /lib/Core
parentf813c88c8cb868fc9c0be78fbf92a94d72ac02b0 (diff)
downloadklee-3ca81c2dc3881aec0bbf94646c73a148d706c76d.tar.gz
Change `GetConstraintLog` to work with `std::string`s instead of `char*`s
Diffstat (limited to 'lib/Core')
-rw-r--r--lib/Core/Executor.cpp4
-rw-r--r--lib/Core/TimingSolver.h3
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 49df9790..eccdf9eb 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -4734,9 +4734,7 @@ void Executor::getConstraintLog(const ExecutionState &state, std::string &res,
   switch (logFormat) {
   case STP: {
     Query query(state.constraints, ConstantExpr::alloc(0, Expr::Bool));
-    char *log = solver->getConstraintLog(query);
-    res = std::string(log);
-    free(log);
+    res = solver->getConstraintLog(query);
   } break;
 
   case KQUERY: {
diff --git a/lib/Core/TimingSolver.h b/lib/Core/TimingSolver.h
index 0b88be3c..4042c724 100644
--- a/lib/Core/TimingSolver.h
+++ b/lib/Core/TimingSolver.h
@@ -16,6 +16,7 @@
 #include "klee/System/Time.h"
 
 #include <memory>
+#include <string>
 #include <utility>
 #include <vector>
 
@@ -41,7 +42,7 @@ public:
 
   void setTimeout(time::Span t) { solver->setCoreSolverTimeout(t); }
 
-  char *getConstraintLog(const Query &query) {
+  std::string getConstraintLog(const Query &query) {
     return solver->getConstraintLog(query);
   }