Check if a fixedBytes fits an integer type

before looking up the size of the integer type.

Fixes #1150.
This commit is contained in:
Yoichi Hirai 2016-10-13 20:17:13 +02:00
parent 5e75cae28a
commit 8e11bac8de
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992

View File

@ -574,7 +574,11 @@ bool RationalNumberType::isImplicitlyConvertibleTo(Type const& _convertTo) const
{
FixedBytesType const& fixedBytes = dynamic_cast<FixedBytesType const&>(_convertTo);
if (!isFractional())
return fixedBytes.numBytes() * 8 >= integerType()->numBits();
{
if (integerType())
return fixedBytes.numBytes() * 8 >= integerType()->numBits();
return false;
}
else
return false;
}