Skip to content

Commit

Permalink
Fix infinite loop in genAddrMode (#106767)
Browse files Browse the repository at this point in the history
Co-authored-by: EgorBo <egorbo@gmail.com>
  • Loading branch information
github-actions[bot] and EgorBo authored Sep 9, 2024
1 parent fe7898a commit f34e9ac
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,9 +1289,8 @@ bool CodeGen::genCreateAddrMode(
{
cns += addConst->IconValue();
op2 = op2->AsOp()->gtOp1;
goto AGAIN;
}

goto AGAIN;
}
break;

Expand Down
40 changes: 40 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_106607/Runtime_106607.il
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

.assembly extern System.Runtime { }
.assembly extern System.Console { }
.assembly extern xunit.core { }
.assembly Runtime_106607 { }

.class Runtime_106607 extends [System.Runtime]System.Object
{
.method public static int32 Main() nooptimization
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 8
.locals init ([0] int32 num)

ldc.i4 42
stloc.0
ldloc.0
ldc.i4 1620763441
ldc.i4 1453536392
add
add
ldloc.0
ldloc.0
sub
ldc.i4 152872638
ldc.i4.s 31
and
shl
add
call void [System.Console]System.Console::WriteLine(int32)

ldc.i4 100
ret
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).il" />
</ItemGroup>
</Project>

0 comments on commit f34e9ac

Please sign in to comment.