Browse Source

Extensive pathway for reporting transaction execution results.

cl-refactor
Gav Wood 10 years ago
parent
commit
be4e3e0025
  1. 4
      libevmjit-cpp/JitVM.cpp
  2. 2
      libevmjit/Common.h
  3. 2
      libevmjit/Compiler.cpp

4
libevmjit-cpp/JitVM.cpp

@ -69,8 +69,8 @@ bytesConstRef JitVM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _step)
BOOST_THROW_EXCEPTION(BadJumpDestination());
case ReturnCode::OutOfGas:
BOOST_THROW_EXCEPTION(OutOfGas());
case ReturnCode::StackTooSmall:
BOOST_THROW_EXCEPTION(StackTooSmall());
case ReturnCode::StackUnderflow:
BOOST_THROW_EXCEPTION(StackUnderflow());
case ReturnCode::BadInstruction:
BOOST_THROW_EXCEPTION(BadInstruction());
case ReturnCode::LinkerWorkaround: // never happens

2
libevmjit/Common.h

@ -33,7 +33,7 @@ enum class ReturnCode
// Standard error codes
OutOfGas = -1,
StackTooSmall = -2,
StackUnderflow = -2,
BadJumpDestination = -3,
BadInstruction = -4,
Rejected = -5, ///< Input data (code, gas, block info, etc.) does not meet JIT requirement and execution request has been rejected

2
libevmjit/Compiler.cpp

@ -516,7 +516,7 @@ void Compiler::compileBasicBlock(BasicBlock& _basicBlock, RuntimeManager& _runti
auto val = stack.pop();
static_cast<void>(val);
// Generate a dummy use of val to make sure that a get(0) will be emitted at this point,
// so that StackTooSmall will be thrown
// so that StackUnderflow will be thrown
// m_builder.CreateICmpEQ(val, val, "dummy");
break;
}

Loading…
Cancel
Save