mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use isDup/SwapInstruction helper
This commit is contained in:
parent
5c28458920
commit
43719839bf
@ -17,8 +17,6 @@
|
|||||||
|
|
||||||
#include <libevmasm/AssemblyItem.h>
|
#include <libevmasm/AssemblyItem.h>
|
||||||
|
|
||||||
#include <libevmasm/SemanticInformation.h>
|
|
||||||
|
|
||||||
#include <libdevcore/CommonData.h>
|
#include <libdevcore/CommonData.h>
|
||||||
#include <libdevcore/FixedHash.h>
|
#include <libdevcore/FixedHash.h>
|
||||||
|
|
||||||
@ -112,7 +110,7 @@ bool AssemblyItem::canBeFunctional() const
|
|||||||
switch (m_type)
|
switch (m_type)
|
||||||
{
|
{
|
||||||
case Operation:
|
case Operation:
|
||||||
return !SemanticInformation::isDupInstruction(*this) && !SemanticInformation::isSwapInstruction(*this);
|
return !isDupInstruction(instruction()) && !isSwapInstruction(instruction());
|
||||||
case Push:
|
case Push:
|
||||||
case PushString:
|
case PushString:
|
||||||
case PushTag:
|
case PushTag:
|
||||||
|
@ -90,14 +90,14 @@ bool SemanticInformation::isDupInstruction(AssemblyItem const& _item)
|
|||||||
{
|
{
|
||||||
if (_item.type() != Operation)
|
if (_item.type() != Operation)
|
||||||
return false;
|
return false;
|
||||||
return Instruction::DUP1 <= _item.instruction() && _item.instruction() <= Instruction::DUP16;
|
return solidity::isDupInstruction(_item.instruction());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SemanticInformation::isSwapInstruction(AssemblyItem const& _item)
|
bool SemanticInformation::isSwapInstruction(AssemblyItem const& _item)
|
||||||
{
|
{
|
||||||
if (_item.type() != Operation)
|
if (_item.type() != Operation)
|
||||||
return false;
|
return false;
|
||||||
return Instruction::SWAP1 <= _item.instruction() && _item.instruction() <= Instruction::SWAP16;
|
return solidity::isSwapInstruction(_item.instruction());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SemanticInformation::isJumpInstruction(AssemblyItem const& _item)
|
bool SemanticInformation::isJumpInstruction(AssemblyItem const& _item)
|
||||||
|
Loading…
Reference in New Issue
Block a user