mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix crash in throw.
This commit is contained in:
parent
cb1fcaf6f6
commit
2b00804d1d
@ -483,7 +483,7 @@ tuple<bool, rational> RationalNumberType::isValidLiteral(Literal const& _literal
|
||||
!all_of(radixPoint + 1, _literal.value().end(), ::isdigit) ||
|
||||
!all_of(_literal.value().begin(), radixPoint, ::isdigit)
|
||||
)
|
||||
throw;
|
||||
return make_tuple(false, rational(0));
|
||||
//Only decimal notation allowed here, leading zeros would switch to octal.
|
||||
auto fractionalBegin = find_if_not(
|
||||
radixPoint + 1,
|
||||
|
@ -4088,6 +4088,18 @@ BOOST_AUTO_TEST_CASE(using_directive_for_missing_selftype)
|
||||
BOOST_CHECK(expectError(text, false) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(invalid_fixed_point_literal)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract A {
|
||||
function a() {
|
||||
.8E0;
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(expectError(text, false) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(shift_constant_left_negative_rvalue)
|
||||
{
|
||||
char const* text = R"(
|
||||
|
Loading…
Reference in New Issue
Block a user