Merge pull request #7923 from ethereum/assertAddressName

Fix wrong construction of ElementaryTypeNameToken
This commit is contained in:
chriseth 2019-12-09 14:36:01 +01:00 committed by GitHub
commit 0176c97626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -72,6 +72,9 @@ void ElementaryTypeNameToken::assertDetails(Token _baseType, unsigned const& _fi
"No elementary type " + string(TokenTraits::toString(_baseType)) + to_string(_first) + "x" + to_string(_second) + "."
);
}
else
solAssert(_first == 0 && _second == 0, "Unexpected size arguments");
m_token = _baseType;
m_firstNumber = _first;
m_secondNumber = _second;

View File

@ -1678,7 +1678,7 @@ ASTPointer<Expression> Parser::parseLeftHandSideExpression(
expectToken(Token::Payable);
nodeFactory.markEndPosition();
auto expressionType = nodeFactory.createNode<ElementaryTypeName>(
ElementaryTypeNameToken(Token::Address, 160, 0),
ElementaryTypeNameToken(Token::Address, 0, 0),
std::make_optional(StateMutability::Payable)
);
expression = nodeFactory.createNode<ElementaryTypeNameExpression>(expressionType);