mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Check if a fixedBytes fits an integer type
before looking up the size of the integer type. Fixes #1150.
This commit is contained in:
parent
5e75cae28a
commit
8e11bac8de
@ -574,7 +574,11 @@ bool RationalNumberType::isImplicitlyConvertibleTo(Type const& _convertTo) const
|
|||||||
{
|
{
|
||||||
FixedBytesType const& fixedBytes = dynamic_cast<FixedBytesType const&>(_convertTo);
|
FixedBytesType const& fixedBytes = dynamic_cast<FixedBytesType const&>(_convertTo);
|
||||||
if (!isFractional())
|
if (!isFractional())
|
||||||
|
{
|
||||||
|
if (integerType())
|
||||||
return fixedBytes.numBytes() * 8 >= integerType()->numBits();
|
return fixedBytes.numBytes() * 8 >= integerType()->numBits();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user