mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6502 from ethereum/fix-ifn-loop
Fix infinite loop when encountering unexpected test specifications
This commit is contained in:
commit
826f2d9084
@ -550,6 +550,11 @@ void TestFileParser::Scanner::scanNextToken()
|
||||
token = selectToken(Token::Whitespace);
|
||||
else if (isEndOfLine())
|
||||
token = selectToken(Token::EOS);
|
||||
else
|
||||
throw Error(
|
||||
Error::Type::ParserError,
|
||||
"Unexpected character: '" + string{current()} + "'"
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -775,6 +775,14 @@ BOOST_AUTO_TEST_CASE(call_arrow_missing)
|
||||
BOOST_REQUIRE_THROW(parse(source), langutil::Error);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(call_unexpected_character)
|
||||
{
|
||||
char const* source = R"(
|
||||
// f() -> ??
|
||||
)";
|
||||
BOOST_REQUIRE_THROW(parse(source), langutil::Error);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user