From f8ca8411bb89e7dfb2d87c5517ab881afe46138d Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Fri, 3 Dec 2021 15:20:10 -0800 Subject: [PATCH] Revert "[mono][wasm] Fix a windows cross compiler issue. (#62339)" This reverts commit a083a21ec1516a59eb42ebe364c20e78026e3d1d. --- src/mono/mono/mini/method-to-ir.c | 2 +- src/mono/mono/mini/mini.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c index 5835e33e0db5ee..a7146415972d43 100644 --- a/src/mono/mono/mini/method-to-ir.c +++ b/src/mono/mono/mini/method-to-ir.c @@ -2624,7 +2624,7 @@ emit_rgctx_fetch_inline (MonoCompile *cfg, MonoInst *rgctx, MonoJumpInfoRgctxEnt int table_size = mono_class_rgctx_get_array_size (0, entry->in_mrgctx); if (entry->in_mrgctx) - table_size -= MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT / TARGET_SIZEOF_VOID_P; + table_size -= MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT / sizeof (TARGET_SIZEOF_VOID_P); MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, slot_ins->dreg, table_size - 1); MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBGE, slowpath_bb); diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h index 943df2b71b2295..207560d805d6f9 100644 --- a/src/mono/mono/mini/mini.h +++ b/src/mono/mono/mini/mini.h @@ -1103,8 +1103,7 @@ typedef struct { gpointer infos [MONO_ZERO_LEN_ARRAY]; } MonoMethodRuntimeGenericContext; -/* MONO_ABI_SIZEOF () would include the 'infos' field as well */ -#define MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT (TARGET_SIZEOF_VOID_P * 2) +#define MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT (MONO_ABI_SIZEOF (MonoMethodRuntimeGenericContext) - MONO_ZERO_LEN_ARRAY * TARGET_SIZEOF_VOID_P) #define MONO_RGCTX_SLOT_MAKE_RGCTX(i) (i) #define MONO_RGCTX_SLOT_MAKE_MRGCTX(i) ((i) | 0x80000000)