Skip to content

Commit e5fa624

Browse files
committed
Do not use ZYAN_ASSERT for user passed arguments
1 parent 4756724 commit e5fa624

File tree

5 files changed

+281
-114
lines changed

5 files changed

+281
-114
lines changed

include/Zydis/DecoderTypes.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -1253,9 +1253,11 @@ typedef struct ZydisDecodedInstruction_
12531253
typedef struct ZydisDecoderContext_
12541254
{
12551255
/**
1256-
* A pointer to the internal instruction definition.
1256+
* The instruction definition id.
1257+
*
1258+
* Only valid in combination with the instruction encoding.
12571259
*/
1258-
const void* definition;
1260+
ZyanU16 definition_id;
12591261
/**
12601262
* Contains the effective operand-size index.
12611263
*

include/Zydis/Internal/DecoderData.h

+3
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ typedef struct ZydisDecoderTreeNode_
193193
ZydisDecoderTreeNodeValue value;
194194
} ZydisDecoderTreeNode;
195195

196+
// See `ZydisDecoderContext.instruction_id`
197+
ZYAN_STATIC_ASSERT(sizeof(ZydisDecoderTreeNodeValue) == sizeof(ZyanU16));
198+
196199
/* ---------------------------------------------------------------------------------------------- */
197200

198201
#pragma pack(pop)

0 commit comments

Comments
 (0)