mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix crash with oversized address literals
This commit is contained in:
parent
8db2cad45c
commit
33ff2b16ff
@ -940,7 +940,7 @@ BoolResult RationalNumberType::isExplicitlyConvertibleTo(Type const& _convertTo)
|
|||||||
if (category == Category::FixedBytes)
|
if (category == Category::FixedBytes)
|
||||||
return false;
|
return false;
|
||||||
else if (category == Category::Address)
|
else if (category == Category::Address)
|
||||||
return !(isNegative() || isFractional() || integerType()->numBits() > 160);
|
return !(isNegative() || isFractional() || !integerType() || integerType()->numBits() > 160);
|
||||||
else if (category == Category::Integer)
|
else if (category == Category::Integer)
|
||||||
return false;
|
return false;
|
||||||
else if (auto enumType = dynamic_cast<EnumType const*>(&_convertTo))
|
else if (auto enumType = dynamic_cast<EnumType const*>(&_convertTo))
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
contract C {
|
||||||
|
function f() public pure {
|
||||||
|
address(0x11223345567aaaaaaaaaaaaaaaaaaaaaaaaaaaaa0112233445566778899001122);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 9640: (52-128): Explicit type conversion not allowed from "int_const 1239...(70 digits omitted)...8130" to "address".
|
Loading…
Reference in New Issue
Block a user