From eddd9e65e2ba1dc1147ef7f8faeb9ab6f8fbb4ba Mon Sep 17 00:00:00 2001 From: Guy Lichtman Date: Wed, 1 Aug 2012 15:51:45 +0300 Subject: [PATCH] check in hot patch remove to return immediatly if not needed --- src/hot_patch.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hot_patch.cc b/src/hot_patch.cc index 9662c25..10bb52a 100644 --- a/src/hot_patch.cc +++ b/src/hot_patch.cc @@ -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);