mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rename SUICIDE opcode to SELFDESTRUCT in libevmasm
This commit is contained in:
parent
3cbdafcfe9
commit
693226b1ab
@ -47,7 +47,7 @@ struct EVMSchedule
|
||||
unsigned callStipend = 2300;
|
||||
unsigned callValueTransferGas = 9000;
|
||||
unsigned callNewAccountGas = 25000;
|
||||
unsigned suicideRefundGas = 24000;
|
||||
unsigned selfdestructRefundGas = 24000;
|
||||
unsigned memoryGas = 3;
|
||||
unsigned quadCoeffDiv = 512;
|
||||
unsigned createDataGas = 200;
|
||||
|
@ -61,7 +61,7 @@ namespace GasCosts
|
||||
static unsigned const callStipend = 2300;
|
||||
static unsigned const callValueTransferGas = 9000;
|
||||
static unsigned const callNewAccountGas = 25000;
|
||||
static unsigned const suicideRefundGas = 24000;
|
||||
static unsigned const selfdestructRefundGas = 24000;
|
||||
static unsigned const memoryGas = 3;
|
||||
static unsigned const quadCoeffDiv = 512;
|
||||
static unsigned const createDataGas = 200;
|
||||
|
@ -160,7 +160,7 @@ const std::map<std::string, Instruction> dev::solidity::c_instructions =
|
||||
{ "RETURN", Instruction::RETURN },
|
||||
{ "DELEGATECALL", Instruction::DELEGATECALL },
|
||||
{ "INVALID", Instruction::INVALID },
|
||||
{ "SUICIDE", Instruction::SUICIDE }
|
||||
{ "SELFDESTRUCT", Instruction::SELFDESTRUCT }
|
||||
};
|
||||
|
||||
static const std::map<Instruction, InstructionInfo> c_instructionInfo =
|
||||
@ -293,9 +293,9 @@ static const std::map<Instruction, InstructionInfo> c_instructionInfo =
|
||||
{ Instruction::CALL, { "CALL", 0, 7, 1, true, Tier::Special } },
|
||||
{ Instruction::CALLCODE, { "CALLCODE", 0, 7, 1, true, Tier::Special } },
|
||||
{ Instruction::RETURN, { "RETURN", 0, 2, 0, true, Tier::Zero } },
|
||||
{ Instruction::DELEGATECALL,{ "DELEGATECALL", 0, 6, 1, true, Tier::Special } },
|
||||
{ Instruction::DELEGATECALL, { "DELEGATECALL", 0, 6, 1, true, Tier::Special } },
|
||||
{ Instruction::INVALID, { "INVALID", 0, 0, 0, true, Tier::Zero } },
|
||||
{ Instruction::SUICIDE, { "SUICIDE", 0, 1, 0, true, Tier::Zero } }
|
||||
{ Instruction::SELFDESTRUCT, { "SELFDESTRUCT", 0, 1, 0, true, Tier::Zero } }
|
||||
};
|
||||
|
||||
void dev::solidity::eachInstruction(
|
||||
|
@ -178,7 +178,7 @@ enum class Instruction: uint8_t
|
||||
DELEGATECALL, ///< like CALLCODE but keeps caller's value and sender
|
||||
|
||||
INVALID = 0xfe, ///< invalid instruction for expressing runtime errors (e.g., division-by-zero)
|
||||
SUICIDE = 0xff ///< halt execution and register account for later deletion
|
||||
SELFDESTRUCT = 0xff ///< halt execution and register account for later deletion
|
||||
};
|
||||
|
||||
/// @returns the number of PUSH Instruction _inst
|
||||
|
@ -200,7 +200,7 @@ struct UnreachableCode
|
||||
it[0] != Instruction::RETURN &&
|
||||
it[0] != Instruction::STOP &&
|
||||
it[0] != Instruction::INVALID &&
|
||||
it[0] != Instruction::SUICIDE
|
||||
it[0] != Instruction::SELFDESTRUCT
|
||||
)
|
||||
return false;
|
||||
|
||||
|
@ -116,7 +116,7 @@ bool SemanticInformation::altersControlFlow(AssemblyItem const& _item)
|
||||
case Instruction::JUMP:
|
||||
case Instruction::JUMPI:
|
||||
case Instruction::RETURN:
|
||||
case Instruction::SUICIDE:
|
||||
case Instruction::SELFDESTRUCT:
|
||||
case Instruction::STOP:
|
||||
case Instruction::INVALID:
|
||||
return true;
|
||||
|
@ -648,7 +648,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
case Location::Selfdestruct:
|
||||
arguments.front()->accept(*this);
|
||||
utils().convertType(*arguments.front()->annotation().type, *function.parameterTypes().front(), true);
|
||||
m_context << Instruction::SUICIDE;
|
||||
m_context << Instruction::SELFDESTRUCT;
|
||||
break;
|
||||
case Location::SHA3:
|
||||
{
|
||||
|
@ -152,8 +152,8 @@ std::map<string, dev::solidity::Instruction> const& Parser::instructions()
|
||||
s_instructions[name] = instruction.second;
|
||||
}
|
||||
|
||||
// add alias for selfdestruct
|
||||
s_instructions["selfdestruct"] = solidity::Instruction::SUICIDE;
|
||||
// add alias for suicide
|
||||
s_instructions["suicide"] = solidity::Instruction::SELFDESTRUCT;
|
||||
}
|
||||
return s_instructions;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user