diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-12 23:35:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 23:35:46 +0800 |
commit | 7453ff0f3a94ce4ddce55cdbb77146dd75a01e1c (patch) | |
tree | b320870956c3ff96f46da77d34a5d93f850a6472 /libsolidity | |
parent | c3dc67d0e0c311a907e7a27e159f9159d78af949 (diff) | |
parent | db40bd46afe6c33af2f3b7e0d9a268e088592b2c (diff) | |
download | dexon-solidity-7453ff0f3a94ce4ddce55cdbb77146dd75a01e1c.tar dexon-solidity-7453ff0f3a94ce4ddce55cdbb77146dd75a01e1c.tar.gz dexon-solidity-7453ff0f3a94ce4ddce55cdbb77146dd75a01e1c.tar.bz2 dexon-solidity-7453ff0f3a94ce4ddce55cdbb77146dd75a01e1c.tar.lz dexon-solidity-7453ff0f3a94ce4ddce55cdbb77146dd75a01e1c.tar.xz dexon-solidity-7453ff0f3a94ce4ddce55cdbb77146dd75a01e1c.tar.zst dexon-solidity-7453ff0f3a94ce4ddce55cdbb77146dd75a01e1c.zip |
Merge pull request #3873 from ethereum/returnVarStorage
Fix internal compiler error when parsing ``var`` declaration without …
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 6 |
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(); |