Replace raw throw with BOOST_THROW_EXCEPTION.

This commit is contained in:
Alexander Arlt
2021-02-18 20:23:59 -05:00
parent 5c6633f975
commit c44bb7e7ef
14 changed files with 70 additions and 67 deletions
@@ -95,7 +95,7 @@ u256 EVMInstructionInterpreter::eval(
switch (_instruction)
{
case Instruction::STOP:
throw ExplicitlyTerminated();
BOOST_THROW_EXCEPTION(ExplicitlyTerminated());
// --------------- arithmetic ---------------
case Instruction::ADD:
return arg[0] + arg[1];
@@ -328,18 +328,18 @@ u256 EVMInstructionInterpreter::eval(
if (accessMemory(arg[0], arg[1]))
data = readMemory(arg[0], arg[1]);
logTrace(_instruction, arg, data);
throw ExplicitlyTerminated();
BOOST_THROW_EXCEPTION(ExplicitlyTerminated());
}
case Instruction::REVERT:
accessMemory(arg[0], arg[1]);
logTrace(_instruction, arg);
throw ExplicitlyTerminated();
BOOST_THROW_EXCEPTION(ExplicitlyTerminated());
case Instruction::INVALID:
logTrace(_instruction);
throw ExplicitlyTerminated();
BOOST_THROW_EXCEPTION(ExplicitlyTerminated());
case Instruction::SELFDESTRUCT:
logTrace(_instruction, arg);
throw ExplicitlyTerminated();
BOOST_THROW_EXCEPTION(ExplicitlyTerminated());
case Instruction::POP:
break;
// --------------- invalid in strict assembly ---------------
@@ -527,6 +527,6 @@ void EVMInstructionInterpreter::logTrace(std::string const& _pseudoInstruction,
if (m_state.maxTraceSize > 0 && m_state.trace.size() >= m_state.maxTraceSize)
{
m_state.trace.emplace_back("Trace size limit reached.");
throw TraceLimitReached();
BOOST_THROW_EXCEPTION(TraceLimitReached());
}
}