about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2024-02-22 23:00:38 +0000
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2024-02-27 09:45:01 +0000
commitb0261e097e1bc28c730af960e06005d5158d7f36 (patch)
tree40852d33dadfcbfdb40f1e7ba0294cc7f5c84fa5 /lib
parent7a640c68ba7517b4a64f2cd684e91bd3de804580 (diff)
downloadklee-b0261e097e1bc28c730af960e06005d5158d7f36.tar.gz
Simplified callExternalFunction by using toConstant instead of getValue
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/Executor.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index d12af171..b93981c9 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -4018,17 +4018,10 @@ void Executor::callExternalFunction(ExecutionState &state,
     if (ExternalCalls == ExternalCallPolicy::All ||
         ExternalCalls == ExternalCallPolicy::OverApprox) {
       *ai = optimizer.optimizeExpr(*ai, true);
-      ref<ConstantExpr> cvalue = getValueFromSeeds(state, *ai);
-      /* If no seed evaluation results in a constant, call the solver */
-      if (!cvalue) {
-        [[maybe_unused]] bool success = solver->getValue(
-            state.constraints, *ai, cvalue, state.queryMetaData);
-        assert(success && "FIXME: Unhandled solver failure");
-      }
-
+      ref<ConstantExpr> cvalue =
+          toConstant(state, *ai, "external call",
+                     ExternalCalls == ExternalCallPolicy::All);
       cvalue->toMemory(&args[wordIndex]);
-      if (ExternalCalls == ExternalCallPolicy::All)
-        addConstraint(state, EqExpr::create(cvalue, *ai));
 
       ObjectPair op;
       // Checking to see if the argument is a pointer to something