aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Parser.cpp
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-04-12 20:57:14 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-04-12 20:57:14 +0800
commit6862f2294357d18a4640e95e3f9235692e6c055e (patch)
tree8676110f4e82de0cebf5a91bf4547aa499184823 /libsolidity/parsing/Parser.cpp
parentc3dc67d0e0c311a907e7a27e159f9159d78af949 (diff)
downloaddexon-solidity-6862f2294357d18a4640e95e3f9235692e6c055e.tar.gz
dexon-solidity-6862f2294357d18a4640e95e3f9235692e6c055e.tar.zst
dexon-solidity-6862f2294357d18a4640e95e3f9235692e6c055e.zip
Fix internal compiler error when parsing ``var`` declaration without identifier.
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-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();