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 | ||||
| 
 | ||||
| /* ============================================================================================== */ | ||||
| /* Debugging macros                                                                               */ | ||||
| /* Debugging and optimization macros                                                              */ | ||||
| /* ============================================================================================== */ | ||||
| 
 | ||||
| #define ZYDIS_ASSERT(condition) assert(condition) | ||||
| #define ZYDIS_UNREACHABLE assert(0) | ||||
| 
 | ||||
| #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) | ||||
| #endif | ||||
| 
 | ||||
| /* ============================================================================================== */ | ||||
| /* Utils                                                                                          */ | ||||
|  |  | |||
|  | @ -296,7 +296,7 @@ ZydisBool ZydisInstructionTableGetDefinition(const ZydisInstructionTableNode* no | |||
|         break; | ||||
|     default: | ||||
|         ZYDIS_UNREACHABLE; | ||||
|         return ZYDIS_FALSE; | ||||
|         //return ZYDIS_FALSE;
 | ||||
|     }    | ||||
|     return ZYDIS_TRUE; | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue