VALGRIND_DISCARD_TRANSLATIONS (orig_code - 11, sizeof (gpointer));
}
} else {
- if ((((guint64)(addr)) >> 32) != 0) {
+ gboolean disp_32bit = ((((gint64)addr - (gint64)orig_code)) < (1 << 30)) && ((((gint64)addr - (gint64)orig_code)) > -(1 << 30));
+
+ if ((((guint64)(addr)) >> 32) != 0 && !disp_32bit) {
#ifdef MONO_ARCH_NOMAP32BIT
/* Print some diagnostics */
MonoJitInfo *ji = mono_jit_info_table_find (mono_domain_get (), (char*)orig_code);
mono_arch_flush_icache (thunk_start, thunk_code - thunk_start);
#endif
}
- g_assert ((((guint64)(orig_code)) >> 32) == 0);
if (can_write) {
InterlockedExchange ((gint32*)(orig_code - 4), ((gint64)addr - (gint64)orig_code));
VALGRIND_DISCARD_TRANSLATIONS (orig_code - 5, 4);