Skip to content

Commit

Permalink
[mono][wasm] Fix a windows cross compiler issue. (#62339)
Browse files Browse the repository at this point in the history
Fixes #61721.
  • Loading branch information
vargaz committed Dec 3, 2021
1 parent 2564449 commit a083a21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mono/mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 / sizeof (TARGET_SIZEOF_VOID_P);
table_size -= MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT / 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);

Expand Down
3 changes: 2 additions & 1 deletion src/mono/mono/mini/mini.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,8 @@ typedef struct {
gpointer infos [MONO_ZERO_LEN_ARRAY];
} MonoMethodRuntimeGenericContext;

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

#define MONO_RGCTX_SLOT_MAKE_RGCTX(i) (i)
#define MONO_RGCTX_SLOT_MAKE_MRGCTX(i) ((i) | 0x80000000)
Expand Down

0 comments on commit a083a21

Please sign in to comment.