Skip to content

Commit a083a21

Browse files
authored
[mono][wasm] Fix a windows cross compiler issue. (#62339)
Fixes #61721.
1 parent 2564449 commit a083a21

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/mono/mono/mini/method-to-ir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,7 @@ emit_rgctx_fetch_inline (MonoCompile *cfg, MonoInst *rgctx, MonoJumpInfoRgctxEnt
26242624

26252625
int table_size = mono_class_rgctx_get_array_size (0, entry->in_mrgctx);
26262626
if (entry->in_mrgctx)
2627-
table_size -= MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT / sizeof (TARGET_SIZEOF_VOID_P);
2627+
table_size -= MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT / TARGET_SIZEOF_VOID_P;
26282628
MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, slot_ins->dreg, table_size - 1);
26292629
MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBGE, slowpath_bb);
26302630

src/mono/mono/mini/mini.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,8 @@ typedef struct {
10971097
gpointer infos [MONO_ZERO_LEN_ARRAY];
10981098
} MonoMethodRuntimeGenericContext;
10991099

1100-
#define MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT (MONO_ABI_SIZEOF (MonoMethodRuntimeGenericContext) - MONO_ZERO_LEN_ARRAY * TARGET_SIZEOF_VOID_P)
1100+
/* MONO_ABI_SIZEOF () would include the 'infos' field as well */
1101+
#define MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT (TARGET_SIZEOF_VOID_P * 2)
11011102

11021103
#define MONO_RGCTX_SLOT_MAKE_RGCTX(i) (i)
11031104
#define MONO_RGCTX_SLOT_MAKE_MRGCTX(i) ((i) | 0x80000000)

0 commit comments

Comments
 (0)