mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Support both suicide/selfdestruct in inline assembly
This commit is contained in:
parent
d5cfb17b32
commit
6afdee5958
@ -1,5 +1,9 @@
|
|||||||
### 0.4.3 (unreleased)
|
### 0.4.3 (unreleased)
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Inline assembly: support both `sucide` and `selfdestruct` opcodes
|
||||||
|
(note: `suicide` is deprecated)
|
||||||
|
|
||||||
### 0.4.2 (2016-09-17)
|
### 0.4.2 (2016-09-17)
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
@ -133,6 +133,7 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
|
|||||||
// Allowed instructions, lowercase names.
|
// Allowed instructions, lowercase names.
|
||||||
static map<string, dev::solidity::Instruction> s_instructions;
|
static map<string, dev::solidity::Instruction> s_instructions;
|
||||||
if (s_instructions.empty())
|
if (s_instructions.empty())
|
||||||
|
{
|
||||||
for (auto const& instruction: solidity::c_instructions)
|
for (auto const& instruction: solidity::c_instructions)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
@ -141,12 +142,14 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
|
|||||||
)
|
)
|
||||||
continue;
|
continue;
|
||||||
string name = instruction.first;
|
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); });
|
transform(name.begin(), name.end(), name.begin(), [](unsigned char _c) { return tolower(_c); });
|
||||||
s_instructions[name] = instruction.second;
|
s_instructions[name] = instruction.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add alias for selfdestruct
|
||||||
|
s_instructions["selfdestruct"] = solidity::Instruction::SUICIDE;
|
||||||
|
}
|
||||||
|
|
||||||
Statement ret;
|
Statement ret;
|
||||||
switch (m_scanner->currentToken())
|
switch (m_scanner->currentToken())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user