aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbakaoh <tatattai@gmail.com>2018-08-28 12:11:40 +0800
committerbakaoh <tatattai@gmail.com>2018-08-28 12:11:40 +0800
commitc458f5988bc4c5bcb61135b5eec217f1be7cd33c (patch)
tree9a2c1ad68c3effd730d4ad41795c136133146f15
parent410d288dfc2e08c42df58c7e01ad5c332ce92727 (diff)
downloaddexon-solidity-c458f5988bc4c5bcb61135b5eec217f1be7cd33c.tar
dexon-solidity-c458f5988bc4c5bcb61135b5eec217f1be7cd33c.tar.gz
dexon-solidity-c458f5988bc4c5bcb61135b5eec217f1be7cd33c.tar.bz2
dexon-solidity-c458f5988bc4c5bcb61135b5eec217f1be7cd33c.tar.lz
dexon-solidity-c458f5988bc4c5bcb61135b5eec217f1be7cd33c.tar.xz
dexon-solidity-c458f5988bc4c5bcb61135b5eec217f1be7cd33c.tar.zst
dexon-solidity-c458f5988bc4c5bcb61135b5eec217f1be7cd33c.zip
Fix#4743: Incorrect source location for nameless parameters
-rw-r--r--libsolidity/parsing/Parser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index 0bee2a91..7ebcf704 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -572,6 +572,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
Token::Value token = m_scanner->currentToken();
if (_options.isStateVariable && Token::isVariableVisibilitySpecifier(token))
{
+ nodeFactory.markEndPosition();
if (visibility != Declaration::Visibility::Default)
{
parserError(string(
@@ -616,21 +617,21 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
}
else
break;
+ nodeFactory.markEndPosition();
m_scanner->next();
}
}
- nodeFactory.markEndPosition();
if (_options.allowEmptyName && m_scanner->currentToken() != Token::Identifier)
{
identifier = make_shared<ASTString>("");
solAssert(!_options.allowVar, ""); // allowEmptyName && allowVar makes no sense
- if (type)
- nodeFactory.setEndPositionFromNode(type);
- // if type is null this has already caused an error
}
else
+ {
+ nodeFactory.markEndPosition();
identifier = expectIdentifierToken();
+ }
ASTPointer<Expression> value;
if (_options.allowInitialValue)
{