aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <yhirai@pira.jp>2016-10-07 17:28:16 +0800
committerGitHub <noreply@github.com>2016-10-07 17:28:16 +0800
commit8572664ac2e955cc08b665f645ad4b1cd964584b (patch)
tree332d9b4dc16e8b441b9686f3e301b5bda47b49c8
parentd855f645ee5f1b444edfc444b2d26787ef381f09 (diff)
parent9f61ae924e0222c35eb58bceea8b201da42cbd5f (diff)
downloaddexon-solidity-8572664ac2e955cc08b665f645ad4b1cd964584b.tar
dexon-solidity-8572664ac2e955cc08b665f645ad4b1cd964584b.tar.gz
dexon-solidity-8572664ac2e955cc08b665f645ad4b1cd964584b.tar.bz2
dexon-solidity-8572664ac2e955cc08b665f645ad4b1cd964584b.tar.lz
dexon-solidity-8572664ac2e955cc08b665f645ad4b1cd964584b.tar.xz
dexon-solidity-8572664ac2e955cc08b665f645ad4b1cd964584b.tar.zst
dexon-solidity-8572664ac2e955cc08b665f645ad4b1cd964584b.zip
Merge pull request #1156 from ethereum/inline-assembly-address
Support address in inline assembly
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp3
-rw-r--r--test/libsolidity/InlineAssembly.cpp2
3 files changed, 5 insertions, 1 deletions
diff --git a/Changelog.md b/Changelog.md
index 8a243a36..1560990d 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -8,6 +8,7 @@ Features:
Bugfixes:
* Disallow unknown options in `solc`
+ * Inline assembly: support the `address` opcode
### 0.4.2 (2016-09-17)
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp
index 196b314d..ee9c150e 100644
--- a/libsolidity/inlineasm/AsmParser.cpp
+++ b/libsolidity/inlineasm/AsmParser.cpp
@@ -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.
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp
index 9e96246d..136d72e6 100644
--- a/test/libsolidity/InlineAssembly.cpp
+++ b/test/libsolidity/InlineAssembly.cpp
@@ -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)