check in hot patch remove to return immediatly if not needed

pull/15/head
Guy Lichtman 2012-08-01 15:51:45 +03:00
parent 23dd5f824c
commit eddd9e65e2
1 changed files with 5 additions and 0 deletions

View File

@ -182,6 +182,11 @@ int hot_patch_function (void* targetFunction, void* newFunction, void * trampoli
*/
void remove_hot_patch_function (void* targetFunction, void * trampolineFunction, unsigned int trampolinesize, bool info_print, const char * log_prefix)
{
if(trampolinesize == 0)
{
//nothing todo. As hot patch was not set.
return;
}
cond_info_print(info_print, "%s removing hot patching function: 0x%x",log_prefix, targetFunction);
DATATYPE_ADDRESS targetPage = get_page_address(targetFunction);
cond_info_print(info_print, "%s targetPage: 0x%x targetFunction: 0x%x",log_prefix, targetPage, targetFunction);