Skip to content

Commit f34e9ac

Browse files
Fix infinite loop in genAddrMode (#106767)
Co-authored-by: EgorBo <[email protected]>
1 parent fe7898a commit f34e9ac

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

src/coreclr/jit/codegencommon.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1289,9 +1289,8 @@ bool CodeGen::genCreateAddrMode(
12891289
{
12901290
cns += addConst->IconValue();
12911291
op2 = op2->AsOp()->gtOp1;
1292+
goto AGAIN;
12921293
}
1293-
1294-
goto AGAIN;
12951294
}
12961295
break;
12971296

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
.assembly extern System.Runtime { }
5+
.assembly extern System.Console { }
6+
.assembly extern xunit.core { }
7+
.assembly Runtime_106607 { }
8+
9+
.class Runtime_106607 extends [System.Runtime]System.Object
10+
{
11+
.method public static int32 Main() nooptimization
12+
{
13+
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
14+
01 00 00 00
15+
)
16+
.entrypoint
17+
.maxstack 8
18+
.locals init ([0] int32 num)
19+
20+
ldc.i4 42
21+
stloc.0
22+
ldloc.0
23+
ldc.i4 1620763441
24+
ldc.i4 1453536392
25+
add
26+
add
27+
ldloc.0
28+
ldloc.0
29+
sub
30+
ldc.i4 152872638
31+
ldc.i4.s 31
32+
and
33+
shl
34+
add
35+
call void [System.Console]System.Console::WriteLine(int32)
36+
37+
ldc.i4 100
38+
ret
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk.IL">
2+
<PropertyGroup>
3+
<DebugType>None</DebugType>
4+
<Optimize>True</Optimize>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<Compile Include="$(MSBuildProjectName).il" />
8+
</ItemGroup>
9+
</Project>

0 commit comments

Comments
 (0)