Merge pull request #10582 from ethereum/addr-literal

Fix crash with oversized address literals
This commit is contained in:
chriseth
2020-12-14 12:14:28 +01:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -940,7 +940,7 @@ BoolResult RationalNumberType::isExplicitlyConvertibleTo(Type const& _convertTo)
if (category == Category::FixedBytes)
return false;
else if (category == Category::Address)
return !(isNegative() || isFractional() || integerType()->numBits() > 160);
return !(isNegative() || isFractional() || !integerType() || integerType()->numBits() > 160);
else if (category == Category::Integer)
return false;
else if (auto enumType = dynamic_cast<EnumType const*>(&_convertTo))