aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-10-05 18:59:16 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-10-06 19:44:33 +0800
commit6afdee5958624a41fcb8f136d1a18f1d8dd816bb (patch)
tree8b38f77fe9effb580f778faf41a5d10bf5e0247a /libsolidity
parentd5cfb17b32147e950a689a507e0d5487dece7e8a (diff)
downloaddexon-solidity-6afdee5958624a41fcb8f136d1a18f1d8dd816bb.tar.gz
dexon-solidity-6afdee5958624a41fcb8f136d1a18f1d8dd816bb.tar.zst
dexon-solidity-6afdee5958624a41fcb8f136d1a18f1d8dd816bb.zip
Support both suicide/selfdestruct in inline assembly
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp
index 5c7163ee..196b314d 100644
--- a/libsolidity/inlineasm/AsmParser.cpp
+++ b/libsolidity/inlineasm/AsmParser.cpp
@@ -133,6 +133,7 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
// Allowed instructions, lowercase names.
static map<string, dev::solidity::Instruction> s_instructions;
if (s_instructions.empty())
+ {
for (auto const& instruction: solidity::c_instructions)
{
if (
@@ -141,12 +142,14 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
)
continue;
string name = instruction.first;
- if (instruction.second == solidity::Instruction::SUICIDE)
- name = "selfdestruct";
transform(name.begin(), name.end(), name.begin(), [](unsigned char _c) { return tolower(_c); });
s_instructions[name] = instruction.second;
}
+ // add alias for selfdestruct
+ s_instructions["selfdestruct"] = solidity::Instruction::SUICIDE;
+ }
+
Statement ret;
switch (m_scanner->currentToken())
{