From 30f15afe0af18e5604fb526a520314897330ca7a Mon Sep 17 00:00:00 2001 From: flobernd Date: Thu, 14 Sep 2017 00:56:01 +0200 Subject: [PATCH] Minor refactorings and bug-fixes --- src/Decoder.c | 2 +- src/DecoderData.c | 2 ++ src/DecoderData.h | 8 +++++--- src/MetaInfo.c | 6 +++--- src/Mnemonic.c | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Decoder.c b/src/Decoder.c index d916c02..8de13f9 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -2203,7 +2203,7 @@ static void ZydisSetAccessedFlags(ZydisDecodedInstruction* instruction, const ZydisAccessedFlags* flags; ZydisGetAccessedFlags(definition, &flags); - ZYDIS_ASSERT(ZYDIS_ARRAY_SIZE(instruction->flags) == ZYDIS_ARRAY_SIZE(flags->action)); + ZYDIS_ASSERT(ZYDIS_ARRAY_SIZE(instruction->accessedFlags) == ZYDIS_ARRAY_SIZE(flags->action)); memcpy(&instruction->accessedFlags, &flags->action, ZYDIS_ARRAY_SIZE(flags->action)); } diff --git a/src/DecoderData.c b/src/DecoderData.c index dfc76ec..4e19b9f 100644 --- a/src/DecoderData.c +++ b/src/DecoderData.c @@ -347,4 +347,6 @@ void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode* node, *info = &instructionEncodings[class]; } +/* ---------------------------------------------------------------------------------------------- */ + /* ============================================================================================== */ diff --git a/src/DecoderData.h b/src/DecoderData.h index 25db56b..b2b4e4b 100644 --- a/src/DecoderData.h +++ b/src/DecoderData.h @@ -24,8 +24,8 @@ ***************************************************************************************************/ -#ifndef ZYDIS_INSTRUCTIONTABLE_H -#define ZYDIS_INSTRUCTIONTABLE_H +#ifndef ZYDIS_DECODERDATA_H +#define ZYDIS_DECODERDATA_H #include #include @@ -241,6 +241,8 @@ typedef struct ZydisInstructionEncodingInfo_ } imm[2]; } ZydisInstructionEncodingInfo; +/* ---------------------------------------------------------------------------------------------- */ + /* ============================================================================================== */ /* Functions */ /* ============================================================================================== */ @@ -285,4 +287,4 @@ ZYDIS_NO_EXPORT void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode* } #endif -#endif /* ZYDIS_INSTRUCTIONTABLE_H */ +#endif /* ZYDIS_DECODERDATA_H */ diff --git a/src/MetaInfo.c b/src/MetaInfo.c index f3d221e..2f57038 100644 --- a/src/MetaInfo.c +++ b/src/MetaInfo.c @@ -30,9 +30,9 @@ /* Enum strings */ /* ============================================================================================== */ -#include -#include -#include +#include +#include +#include /* ============================================================================================== */ /* Exported functions */ diff --git a/src/Mnemonic.c b/src/Mnemonic.c index d96424d..1feec10 100644 --- a/src/Mnemonic.c +++ b/src/Mnemonic.c @@ -30,7 +30,7 @@ /* Mnemonic strings */ /* ============================================================================================== */ -#include +#include /* ============================================================================================== */ /* Exported functions */