Skip to content

Commit

Permalink
Merge pull request #673 from ethereum/result
Browse files Browse the repository at this point in the history
Add wording about output_data in case of output_size=0
  • Loading branch information
axic committed Nov 9, 2022
2 parents 1378b6f + 9f3456b commit c982f26
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions include/evmc/evmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,20 +412,21 @@ struct evmc_result
/**
* The reference to output data.
*
* The output contains data coming from RETURN opcode (iff evmc_result::code
* field is ::EVMC_SUCCESS) or from REVERT opcode.
* The output contains data coming from RETURN opcode (iff evmc_result::code
* field is ::EVMC_SUCCESS) or from REVERT opcode.
*
* The memory containing the output data is owned by EVM and has to be
* freed with evmc_result::release().
* The memory containing the output data is owned by EVM and has to be
* freed with evmc_result::release().
*
* This MAY be NULL.
* This pointer MAY be NULL.
* If evmc_result::output_size is 0 this pointer MUST NOT be dereferenced.
*/
const uint8_t* output_data;

/**
* The size of the output data.
*
* If output_data is NULL this MUST be 0.
* If evmc_result::output_data is NULL this MUST be 0.
*/
size_t output_size;

Expand Down Expand Up @@ -463,13 +464,13 @@ struct evmc_result
/**
* Reserved data that MAY be used by a evmc_result object creator.
*
* This reserved 4 bytes together with 20 bytes from create_address form
* 24 bytes of memory called "optional data" within evmc_result struct
* to be optionally used by the evmc_result object creator.
* This reserved 4 bytes together with 20 bytes from create_address form
* 24 bytes of memory called "optional data" within evmc_result struct
* to be optionally used by the evmc_result object creator.
*
* @see evmc_result_optional_data, evmc_get_optional_data().
* @see evmc_result_optional_data, evmc_get_optional_data().
*
* Also extends the size of the evmc_result to 64 bytes (full cache line).
* Also extends the size of the evmc_result to 64 bytes (full cache line).
*/
uint8_t padding[4];
};
Expand Down Expand Up @@ -1111,7 +1112,7 @@ struct evmc_vm
/**
* Optional pointer to function modifying VM's options.
*
* If the VM does not support this feature the pointer can be NULL.
* If the VM does not support this feature the pointer can be NULL.
*/
evmc_set_option_fn set_option;
};
Expand Down

0 comments on commit c982f26

Please sign in to comment.