Skip to content

Commit

Permalink
[mono][aot] Fix an assert. (#84385)
Browse files Browse the repository at this point in the history
This is hit when AOTing GitHub_27678.dll.
  • Loading branch information
vargaz authored Apr 6, 2023
1 parent f0fbcc2 commit ab57c57
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/mono/mono/mini/memory-access.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,19 @@ mini_emit_memcpy (MonoCompile *cfg, int destreg, int doffset, int srcreg, int so
{
int cur_reg;

/*FIXME arbitrary hack to avoid unbound code expansion.*/
g_assert (size < MAX_INLINE_COPY_SIZE);
if (size >= MAX_INLINE_COPY_SIZE) {
MonoInst *iargs [3];

int reg = alloc_ireg (cfg);
EMIT_NEW_UNALU (cfg, iargs [0], OP_MOVE, reg, destreg);
reg = alloc_ireg (cfg);
EMIT_NEW_UNALU (cfg, iargs [1], OP_MOVE, reg, srcreg);
EMIT_NEW_ICONST (cfg, iargs [2], size);

mono_emit_method_call (cfg, mini_get_memcpy_method (), iargs, NULL);
return;
}

g_assert (align > 0);

MONO_DISABLE_WARNING(4127) /* conditional expression is constant */
Expand Down

0 comments on commit ab57c57

Please sign in to comment.