about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-08-12 17:42:11 +0100
committerYour Name <you@example.com>2021-08-12 17:42:11 +0100
commitd2d7585db553ca69830f7eadcc0f8a5c7feaf6d3 (patch)
treeb934eec050051c455877a8f6ff54dd0ae5884bb5
parentcfbff436a58e6fe0d826ebb8b9cf0f148dffafcc (diff)
downloadafl++-d2d7585db553ca69830f7eadcc0f8a5c7feaf6d3.tar.gz
Changes to remove hard-coding of MAP_SIZE_POW2 when inline instrumentation is disabled
-rw-r--r--frida_mode/src/instrument/instrument.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/frida_mode/src/instrument/instrument.c b/frida_mode/src/instrument/instrument.c
index 67aafa5a..fddff19a 100644
--- a/frida_mode/src/instrument/instrument.c
+++ b/frida_mode/src/instrument/instrument.c
@@ -116,8 +116,8 @@ __attribute__((hot)) static void on_basic_block(GumCpuContext *context,
 
   }
 
-  instrument_previous_pc =
-      ((current_pc & (MAP_SIZE - 1) >> 1)) | ((current_pc & 0x1) << 15);
+  instrument_previous_pc = ((current_pc & (MAP_SIZE - 1) >> 1)) |
+                           ((current_pc & 0x1) << (MAP_SIZE_POW2 - 1));
 
 }