mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11073 from ethereum/extractStackReuseTests
Extract StackReuseCodegen tests.
This commit is contained in:
@@ -353,18 +353,19 @@ void solidity::evmasm::eachInstruction(
|
||||
}
|
||||
}
|
||||
|
||||
string solidity::evmasm::disassemble(bytes const& _mem)
|
||||
string solidity::evmasm::disassemble(bytes const& _mem, string const& _delimiter)
|
||||
{
|
||||
stringstream ret;
|
||||
eachInstruction(_mem, [&](Instruction _instr, u256 const& _data) {
|
||||
if (!isValidInstruction(_instr))
|
||||
ret << "0x" << std::uppercase << std::hex << static_cast<int>(_instr) << " ";
|
||||
ret << "0x" << std::uppercase << std::hex << static_cast<int>(_instr) << _delimiter;
|
||||
else
|
||||
{
|
||||
InstructionInfo info = instructionInfo(_instr);
|
||||
ret << info.name << " ";
|
||||
ret << info.name;
|
||||
if (info.additional)
|
||||
ret << "0x" << std::uppercase << std::hex << _data << " ";
|
||||
ret << " 0x" << std::uppercase << std::hex << _data;
|
||||
ret << _delimiter;
|
||||
}
|
||||
});
|
||||
return ret.str();
|
||||
|
||||
@@ -314,6 +314,6 @@ extern const std::map<std::string, Instruction> c_instructions;
|
||||
void eachInstruction(bytes const& _mem, std::function<void(Instruction,u256 const&)> const& _onInstruction);
|
||||
|
||||
/// Convert from EVM code to simple EVM assembly language.
|
||||
std::string disassemble(bytes const& _mem);
|
||||
std::string disassemble(bytes const& _mem, std::string const& _delimiter = " ");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user