mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added tests and support for suffix function with 2 arguments
This commit is contained in:
committed by
Kamil Śliwak
parent
2bf76afec1
commit
e4eec4d910
@@ -3174,10 +3174,24 @@ vector<smtutil::Expression> SMTEncoder::symbolicArguments(FunctionCall const& _f
|
||||
firstParam = 1;
|
||||
}
|
||||
|
||||
solAssert((arguments.size() + firstParam) == functionParams.size(), "");
|
||||
for (unsigned i = 0; i < arguments.size(); ++i)
|
||||
args.push_back(expr(*arguments.at(i), functionParams.at(i + firstParam)->type()));
|
||||
|
||||
if (_funCall.isSuffixCall() && functionParams.size() == 2)
|
||||
{
|
||||
solAssert(!funType->hasBoundFirstArgument());
|
||||
solAssert(arguments.size() == 1);
|
||||
auto&& literalType = dynamic_cast<RationalNumberType const*>(arguments[0]->annotation().type);
|
||||
solAssert(literalType);
|
||||
auto&& [mantissa, exponent] = literalType->fractionalDecomposition();
|
||||
solAssert(mantissa && exponent);
|
||||
solAssert(!mantissa->isNegative() && !exponent->isNegative());
|
||||
args.emplace_back(mantissa->literalValue(nullptr));
|
||||
args.emplace_back(exponent->literalValue(nullptr));
|
||||
}
|
||||
else
|
||||
{
|
||||
solAssert((arguments.size() + firstParam) == functionParams.size(), "");
|
||||
for (unsigned i = 0; i < arguments.size(); ++i)
|
||||
args.push_back(expr(*arguments.at(i), functionParams.at(i + firstParam)->type()));
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user