mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1101 from ethereum/fixcrash
Fix crash for TypeName[k].
This commit is contained in:
commit
0bc8476aea
@ -1,3 +1,11 @@
|
||||
### 0.4.2
|
||||
|
||||
* Type Checker: Fixed a crash about invalid array types.
|
||||
|
||||
### 0.4.1 (2016-09-09)
|
||||
|
||||
* Build System: Fixes to allow library compilation.
|
||||
|
||||
### 0.4.0 (2016-09-08)
|
||||
|
||||
This release deliberately breaks backwards compatibility mostly to
|
||||
|
@ -1438,7 +1438,7 @@ bool TypeChecker::visit(IndexAccess const& _access)
|
||||
length->literalValue(nullptr)
|
||||
));
|
||||
else
|
||||
typeError(index->location(), "Integer constant expected.");
|
||||
fatalTypeError(index->location(), "Integer constant expected.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4009,6 +4009,16 @@ BOOST_AUTO_TEST_CASE(external_constructor)
|
||||
BOOST_CHECK(expectError(text, false) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(invalid_array_as_statement)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
struct S { uint x; }
|
||||
function test(uint k) { S[k]; }
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(expectError(text, false) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user