mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix internal compiler error when parsing `var` declaration without identifier.
This commit is contained in:
@@ -607,8 +607,10 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
|
||||
if (_options.allowEmptyName && m_scanner->currentToken() != Token::Identifier)
|
||||
{
|
||||
identifier = make_shared<ASTString>("");
|
||||
solAssert(type != nullptr, "");
|
||||
nodeFactory.setEndPositionFromNode(type);
|
||||
solAssert(!_options.allowVar, ""); // allowEmptyName && allowVar makes no sense
|
||||
if (type)
|
||||
nodeFactory.setEndPositionFromNode(type);
|
||||
// if type is null this has already caused an error
|
||||
}
|
||||
else
|
||||
identifier = expectIdentifierToken();
|
||||
|
||||
Reference in New Issue
Block a user