mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow empty import statements
This commit is contained in:
@@ -221,6 +221,8 @@ ASTPointer<ImportDirective> Parser::parseImportDirective()
|
||||
fatalParserError("Expected import path.");
|
||||
path = getLiteralAndAdvance();
|
||||
}
|
||||
if (path->empty())
|
||||
fatalParserError("Import path cannot be empty.");
|
||||
nodeFactory.markEndPosition();
|
||||
expectToken(Token::Semicolon);
|
||||
return nodeFactory.createNode<ImportDirective>(path, unitAlias, move(symbolAliases));
|
||||
|
||||
Reference in New Issue
Block a user