mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow arrays with negative length
This commit is contained in:
@@ -1919,6 +1919,16 @@ BOOST_AUTO_TEST_CASE(array_with_nonconstant_length)
|
||||
CHECK_ERROR(text, TypeError, "");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(array_with_negative_length)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract c {
|
||||
function f(uint a) { uint8[-1] x; }
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Array with negative length specified");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(array_copy_with_different_types1)
|
||||
{
|
||||
char const* text = R"(
|
||||
|
||||
Reference in New Issue
Block a user