mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Assign cast from constants directly
This commit is contained in:
parent
299dae4d1a
commit
e2959ce55c
@ -1113,6 +1113,14 @@ void SMTEncoder::visitTypeConversion(FunctionCall const& _funCall)
|
|||||||
{
|
{
|
||||||
solAssert(smt::isNumber(*funCallType), "");
|
solAssert(smt::isNumber(*funCallType), "");
|
||||||
|
|
||||||
|
RationalNumberType const* rationalType = isConstant(*argument);
|
||||||
|
if (rationalType)
|
||||||
|
{
|
||||||
|
// The TypeChecker guarantees that a constant fits in the cast size.
|
||||||
|
defineExpr(_funCall, symbArg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto const* fixedCast = dynamic_cast<FixedBytesType const*>(funCallType);
|
auto const* fixedCast = dynamic_cast<FixedBytesType const*>(funCallType);
|
||||||
auto const* fixedArg = dynamic_cast<FixedBytesType const*>(argType);
|
auto const* fixedArg = dynamic_cast<FixedBytesType const*>(argType);
|
||||||
if (fixedCast && fixedArg)
|
if (fixedCast && fixedArg)
|
||||||
|
Loading…
Reference in New Issue
Block a user