Merge pull request #1156 from ethereum/inline-assembly-address

Support address in inline assembly
This commit is contained in:
Yoichi Hirai 2016-10-07 11:28:16 +02:00 committed by GitHub
commit 8572664ac2
3 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Features:
Bugfixes:
* Disallow unknown options in `solc`
* Inline assembly: support the `address` opcode
### 0.4.2 (2016-09-17)

View File

@ -156,12 +156,15 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
case Token::Identifier:
case Token::Return:
case Token::Byte:
case Token::Address:
{
string literal;
if (m_scanner->currentToken() == Token::Return)
literal = "return";
else if (m_scanner->currentToken() == Token::Byte)
literal = "byte";
else if (m_scanner->currentToken() == Token::Address)
literal = "address";
else
literal = m_scanner->currentLiteral();
// first search the set of instructions.

View File

@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(suicide_selfdestruct)
BOOST_AUTO_TEST_CASE(keywords)
{
BOOST_CHECK(successParse("{ byte return }"));
BOOST_CHECK(successParse("{ byte return address }"));
}
BOOST_AUTO_TEST_CASE(constants)