Merge "memcheck: fix guest pc <-> host pc mapping on 64 bit arch"
diff --git a/exec-all.h b/exec-all.h
index 91d1bda..1c69176 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -166,7 +166,7 @@
* guest PC corresponding to that PC in the translation block. This
* arrangement is set by tcg_gen_code_common that initializes this array
* when performing guest code translation. */
- target_ulong* tpc2gpc;
+ uintptr_t* tpc2gpc;
/* Number of pairs (pc_tb, pc_guest) in tpc2gpc array. */
unsigned int tpc2gpc_pairs;
#endif // CONFIG_MEMCHECK
diff --git a/translate-all.c b/translate-all.c
index ed174e7..c89ec8a 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -148,12 +148,13 @@
/* Save translated PC -> guest PC map into TB. */
if (memcheck_enabled && gen_opc_tpc2gpc_pairs && is_cpu_user(env)) {
tb->tpc2gpc =
- qemu_malloc(gen_opc_tpc2gpc_pairs * 2 * sizeof(target_ulong));
+ qemu_malloc(gen_opc_tpc2gpc_pairs * 2 * sizeof(uintptr_t));
if (tb->tpc2gpc != NULL) {
memcpy(tb->tpc2gpc, gen_opc_tpc2gpc_ptr,
- gen_opc_tpc2gpc_pairs * 2 * sizeof(target_ulong));
+ gen_opc_tpc2gpc_pairs * 2 * sizeof(uintptr_t));
tb->tpc2gpc_pairs = gen_opc_tpc2gpc_pairs;
}
+
}
#endif // CONFIG_MEMCHECK