Skip to content

Commit

Permalink
Do not use ZYAN_ASSERT for user passed arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Dec 21, 2021
1 parent 4756724 commit e5fa624
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 114 deletions.
6 changes: 4 additions & 2 deletions include/Zydis/DecoderTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1253,9 +1253,11 @@ typedef struct ZydisDecodedInstruction_
typedef struct ZydisDecoderContext_
{
/**
* A pointer to the internal instruction definition.
* The instruction definition id.
*
* Only valid in combination with the instruction encoding.
*/
const void* definition;
ZyanU16 definition_id;
/**
* Contains the effective operand-size index.
*
Expand Down
3 changes: 3 additions & 0 deletions include/Zydis/Internal/DecoderData.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ typedef struct ZydisDecoderTreeNode_
ZydisDecoderTreeNodeValue value;
} ZydisDecoderTreeNode;

// See `ZydisDecoderContext.instruction_id`
ZYAN_STATIC_ASSERT(sizeof(ZydisDecoderTreeNodeValue) == sizeof(ZyanU16));

/* ---------------------------------------------------------------------------------------------- */

#pragma pack(pop)
Expand Down

0 comments on commit e5fa624

Please sign in to comment.