mirror of https://github.com/x64dbg/zydis
Improved handling of unreachable code
This commit is contained in:
parent
40d6c39dbe
commit
de666d7a4a
|
@ -114,11 +114,22 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
/* Debugging macros */
|
/* Debugging and optimization macros */
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
|
|
||||||
#define ZYDIS_ASSERT(condition) assert(condition)
|
#define ZYDIS_ASSERT(condition) assert(condition)
|
||||||
|
|
||||||
|
#if defined(ZYDIS_MSVC) && defined(ZYDIS_RELEASE)
|
||||||
|
# define ZYDIS_UNREACHABLE
|
||||||
|
#elif defined(ZYDIS_GNUC) && defined(ZYDIS_RELEASE)
|
||||||
|
# if __has_builtin(__builtin_unreachable)
|
||||||
|
# define ZYDIS_UNREACHABLE __builtin_unreachable()
|
||||||
|
# else
|
||||||
|
# define ZYDIS_UNREACHABLE
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
# define ZYDIS_UNREACHABLE assert(0)
|
# define ZYDIS_UNREACHABLE assert(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
/* Utils */
|
/* Utils */
|
||||||
|
|
|
@ -296,7 +296,7 @@ ZydisBool ZydisInstructionTableGetDefinition(const ZydisInstructionTableNode* no
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ZYDIS_UNREACHABLE;
|
ZYDIS_UNREACHABLE;
|
||||||
return ZYDIS_FALSE;
|
//return ZYDIS_FALSE;
|
||||||
}
|
}
|
||||||
return ZYDIS_TRUE;
|
return ZYDIS_TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue