Rename SUICIDE opcode to SELFDESTRUCT in libevmasm

This commit is contained in:
Alex Beregszaszi 2017-02-06 18:35:18 +00:00
parent 3cbdafcfe9
commit 693226b1ab
8 changed files with 11 additions and 11 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 =
@ -295,7 +295,7 @@ static const std::map<Instruction, InstructionInfo> c_instructionInfo =
{ Instruction::RETURN, { "RETURN", 0, 2, 0, true, Tier::Zero } },
{ 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(

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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:
{

View File

@ -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;
}