@@ -551,7 +551,7 @@ void CHC::endVisit(UnaryOperation const& _op)
551
551
{
552
552
std::vector<Expression const *> arguments;
553
553
arguments.push_back (&_op.subExpression ());
554
- internalFunctionCall (funDef, &_op , _op.userDefinedFunctionType (), arguments, state ().thisAddress ());
554
+ internalFunctionCall (funDef, std::nullopt , _op.userDefinedFunctionType (), arguments, state ().thisAddress ());
555
555
556
556
createReturnedExpressions (funDef, _op);
557
557
}
@@ -566,7 +566,7 @@ void CHC::endVisit(BinaryOperation const& _op)
566
566
std::vector<Expression const *> arguments;
567
567
arguments.push_back (&_op.leftExpression ());
568
568
arguments.push_back (&_op.rightExpression ());
569
- internalFunctionCall (funDef, &_op , _op.userDefinedFunctionType (), arguments, state ().thisAddress ());
569
+ internalFunctionCall (funDef, std::nullopt , _op.userDefinedFunctionType (), arguments, state ().thisAddress ());
570
570
571
571
createReturnedExpressions (funDef, _op);
572
572
}
@@ -851,14 +851,13 @@ void CHC::visitDeployment(FunctionCall const& _funCall)
851
851
852
852
void CHC::internalFunctionCall (
853
853
FunctionDefinition const * _funDef,
854
- Expression const * _calledExpr ,
854
+ std::optional< Expression const *> _boundArgumentCall ,
855
855
FunctionType const * _funType,
856
856
std::vector<Expression const *> const & _arguments,
857
857
smtutil::Expression _contractAddressValue
858
858
)
859
859
{
860
860
solAssert (m_currentContract, " " );
861
- solAssert (_calledExpr, " " );
862
861
solAssert (_funType, " " );
863
862
864
863
if (_funDef)
@@ -869,7 +868,7 @@ void CHC::internalFunctionCall(
869
868
m_callGraph[m_currentContract].insert (_funDef);
870
869
}
871
870
872
- m_context.addAssertion (predicate (_funDef, _calledExpr , _funType, _arguments, _contractAddressValue));
871
+ m_context.addAssertion (predicate (_funDef, _boundArgumentCall , _funType, _arguments, _contractAddressValue));
873
872
874
873
solAssert (m_errorDest, " " );
875
874
connectBlocks (
@@ -911,7 +910,10 @@ void CHC::internalFunctionCall(FunctionCall const& _funCall)
911
910
std::vector<Expression const *> arguments;
912
911
for (auto & arg: _funCall.sortedArguments ())
913
912
arguments.push_back (&(*arg));
914
- internalFunctionCall (funDef, calledExpr, funType, arguments, contractAddressValue (_funCall));
913
+
914
+ std::optional<Expression const *> boundArgumentCall =
915
+ funType->hasBoundFirstArgument () ? std::make_optional (calledExpr) : std::nullopt;
916
+ internalFunctionCall (funDef, boundArgumentCall, funType, arguments, contractAddressValue (_funCall));
915
917
}
916
918
917
919
void CHC::addNondetCalls (ContractDefinition const & _contract)
@@ -1813,13 +1815,12 @@ smtutil::Expression CHC::predicate(Predicate const& _block)
1813
1815
1814
1816
smtutil::Expression CHC::predicate (
1815
1817
FunctionDefinition const * _funDef,
1816
- Expression const * _calledExpr ,
1818
+ std::optional< Expression const *> _boundArgumentCall ,
1817
1819
FunctionType const * _funType,
1818
1820
std::vector<Expression const *> _arguments,
1819
1821
smtutil::Expression _contractAddressValue
1820
1822
)
1821
1823
{
1822
- solAssert (_calledExpr, " " );
1823
1824
solAssert (_funType, " " );
1824
1825
auto kind = _funType->kind ();
1825
1826
solAssert (kind == FunctionType::Kind::Internal || kind == FunctionType::Kind::External || kind == FunctionType::Kind::BareStaticCall, " " );
@@ -1838,10 +1839,7 @@ smtutil::Expression CHC::predicate(
1838
1839
contract = m_currentContract;
1839
1840
1840
1841
args += currentStateVariables (*contract);
1841
-
1842
- std::optional<Expression const *> calledExpr =
1843
- _funType->hasBoundFirstArgument () ? std::make_optional (_calledExpr) : std::nullopt;
1844
- args += symbolicArguments (_funDef->parameters (), calledExpr, _arguments);
1842
+ args += symbolicArguments (_funDef->parameters (), _arguments, _boundArgumentCall);
1845
1843
if (!usesStaticCall (_funDef, _funType))
1846
1844
{
1847
1845
state ().newState ();
0 commit comments