aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/parsing/Parser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index 2d8ca7d3..618a0896 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -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();