From b0261e097e1bc28c730af960e06005d5158d7f36 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Thu, 22 Feb 2024 23:00:38 +0000 Subject: Simplified callExternalFunction by using toConstant instead of getValue --- lib/Core/Executor.cpp | 13 +++---------- 1 file 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 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 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 -- cgit 1.4.1