-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/9.0-staging] JIT: Include more edges in `BlockDominancePreds…
…` to avoid a JIT crash (#110568) Because of spurious flow it is possible that the preds of the try-begin block are not the only blocks that can dominate a handler. We handled this possibility, but only for finally/fault blocks that can directly have these edges. However, even other handler blocks can be reachable through spurious paths that involves finally/fault blocks, and in these cases returning the preds of the try-begin block is not enough to compute the right dominator statically.
- Loading branch information
1 parent
7eb5ef2
commit 4d2ecdc
Showing
3 changed files
with
86 additions
and
35 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
63 changes: 63 additions & 0 deletions
63
src/tests/JIT/Regression/JitBlue/Runtime_109981/Runtime_109981.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,63 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
using Xunit; | ||
|
||
public class Runtime_109981 | ||
{ | ||
[Fact] | ||
public static int TestEntryPoint() => Foo(14); | ||
|
||
public static int Foo(int x) | ||
{ | ||
if (x == 123) | ||
return 0; | ||
|
||
int sum = 9; | ||
for (int i = 0; i < x; i++) | ||
{ | ||
sum += i; | ||
} | ||
|
||
try | ||
{ | ||
if (x != 123) | ||
return sum; | ||
|
||
try | ||
{ | ||
try | ||
{ | ||
Bar(); | ||
} | ||
finally | ||
{ | ||
sum += 1000; | ||
} | ||
} | ||
catch (ArgumentException) | ||
{ | ||
sum += 10000; | ||
} | ||
} | ||
catch when (Filter()) | ||
{ | ||
sum += 100000; | ||
} | ||
|
||
return sum; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void Bar() | ||
{ | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static bool Filter() | ||
{ | ||
return true; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/tests/JIT/Regression/JitBlue/Runtime_109981/Runtime_109981.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,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |