Skip to content

Commit

Permalink
Rename SUICIDE opcode to SELFDESTRUCT in libevmasm
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Feb 6, 2017
1 parent 3cbdafc commit 693226b
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion libevmasm/EVMSchedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libevmasm/GasMeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions libevmasm/Instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion libevmasm/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libevmasm/PeepholeOptimiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libevmasm/SemanticInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/codegen/ExpressionCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
{
Expand Down
4 changes: 2 additions & 2 deletions libsolidity/inlineasm/AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 693226b

Please sign in to comment.