forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dotnet/coreclr#20838 from briansull/issue_18259
ValueNum add check for ZeroOffsetFldSeq on LclVar reads Commit migrated from dotnet/coreclr@ae4dc9c
- Loading branch information
Showing
6 changed files
with
831 additions
and
61 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
49 changes: 49 additions & 0 deletions
49
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_18259/GitHub_18259.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,49 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
|
||
// Test case for issue 18259 | ||
// | ||
// We were a missing check for ZeroOffsetFldSeq values on LclVar reads | ||
// | ||
// Debug: Outputs 0 | ||
// Release: Outputs 1234 | ||
|
||
struct S1 | ||
{ | ||
public uint F0; | ||
public S1(uint f0): this() { F0 = f0; } | ||
} | ||
|
||
struct S2 | ||
{ | ||
public S1 F1; | ||
public int F2; | ||
public S2(S1 f1): this() { F1 = f1; F2 = 1; } | ||
} | ||
|
||
public class Program | ||
{ | ||
static S2[] s_11 = new S2[]{new S2(new S1(1234u))}; // Assigns 1234 to F1.F0 | ||
public static int Main() | ||
{ | ||
ref S1 vr7 = ref s_11[0].F1; | ||
vr7.F0 = vr7.F0; | ||
|
||
vr7.F0 = 0; // Bug: We fail to update the Map with the proper ValueNum here. | ||
|
||
if (vr7.F0 != 0) // Bug: We continue to return the old value for vr7.F0 | ||
{ | ||
System.Console.WriteLine(vr7.F0); | ||
System.Console.WriteLine("Failed"); | ||
return 101; | ||
} | ||
else | ||
{ | ||
System.Console.WriteLine("Passed"); | ||
return 100; | ||
} | ||
} | ||
} |
Oops, something went wrong.