Skip to content

Commit

Permalink
Merge pull request #173 from ethereum/status-code
Browse files Browse the repository at this point in the history
EVM-C: introduce new status codes
  • Loading branch information
axic authored Mar 26, 2018
2 parents e5a88f8 + 3f081a2 commit 4e9f3d7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions include/evm.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,29 @@ typedef void (*evm_get_block_hash_fn)(struct evm_uint256be* result,
int64_t number);

/// The execution status code.
///
/// @todo: Add status code for out-of-buffer access.
enum evm_status_code {
EVM_SUCCESS = 0, ///< Execution finished with success.
EVM_FAILURE = 1, ///< Generic execution failure.
EVM_OUT_OF_GAS = 2,
EVM_BAD_INSTRUCTION = 3,
EVM_UNDEFINED_INSTRUCTION = 3, ///< Unknown instruction encountered by the VM.
EVM_BAD_JUMP_DESTINATION = 4,
EVM_STACK_OVERFLOW = 5,
EVM_STACK_UNDERFLOW = 6,
EVM_REVERT = 7, ///< Execution terminated with REVERT opcode.
/// Tried to execute an operation which is restricted in static mode.

/// Tried to execute an operation which is restricted in static mode.
///
/// @todo Avoid _ERROR suffix that suggests fatal error.
EVM_STATIC_MODE_ERROR = 8,

/// The dedicated INVALID instruction was hit.
EVM_INVALID_INSTRUCTION = 9,

/// Tried to read outside memory bounds.
///
/// An example is RETURNDATACOPY reading past the available buffer.
EVM_INVALID_MEMORY_ACCESS = 10,

/// The EVM rejected the execution of the given code or message.
///
/// This error SHOULD be used to signal that the EVM is not able to or
Expand Down

0 comments on commit 4e9f3d7

Please sign in to comment.