-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add checks for missing SSA numbers (#57274)
In several places there were cases where we were checking lvaInSsa for the lcl num of a local tree node, but then proceeded to use the ssa number directly after. It is possible for a local to be in SSA without tree nodes themselves having SSA form built for them, for example if unreachable code makes it to SSA building. This adds some additional check for missing SSA numbers.
- Loading branch information
1 parent
f7cd0c6
commit 57839c4
Showing
8 changed files
with
226 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/tests/JIT/Regression/JitBlue/Runtime_57061/Runtime_57061_2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
// Generated by Fuzzlyn v1.2 on 2021-08-16 20:49:50 | ||
// Run on .NET 6.0.0-dev on X86 Windows | ||
// Seed: 5524807387112568570 | ||
// Reduced from 260.9 KiB to 0.8 KiB in 00:20:16 | ||
// Crashes the runtime | ||
using System.Runtime.CompilerServices; | ||
|
||
struct S0 | ||
{ | ||
public uint F0; | ||
} | ||
|
||
public class Runtime_57061_2 | ||
{ | ||
static S0 s_2; | ||
static uint[] s_13; | ||
static sbyte[][] s_110; | ||
static int[] s_111; | ||
private static int Main() | ||
{ | ||
s_2 = s_2; | ||
return Foo(); | ||
} | ||
public static int Foo() | ||
{ | ||
if (M34()) | ||
{ | ||
ref S0 vr1 = ref s_2; | ||
try | ||
{ | ||
M33(); | ||
} | ||
finally | ||
{ | ||
vr1.F0 = s_13[0]; | ||
} | ||
} | ||
|
||
for (int vr2 = 0; vr2 < Bound(); vr2++) | ||
{ | ||
int[] vr3 = s_111; | ||
try | ||
{ | ||
sbyte vr4 = s_110[0][0]; | ||
} | ||
finally | ||
{ | ||
int vr5 = vr3[0]; | ||
} | ||
} | ||
|
||
return 100; | ||
} | ||
|
||
static bool M33() | ||
{ | ||
return default(bool); | ||
} | ||
|
||
static bool M34() | ||
{ | ||
return default(bool); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static int Bound() => 0; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/tests/JIT/Regression/JitBlue/Runtime_57061/Runtime_57061_2.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.