Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit e79a4d5

Browse files
mikednAndyAyersMS
authored andcommitted
Reset lvIsStructField when removing promoted struct vars (#15721)
1 parent d5a9c01 commit e79a4d5

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

src/jit/regalloc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ void Compiler::raAssignVars()
841841
varNum++)
842842
{
843843
noway_assert(lvaTable[varNum].lvRefCnt == 0);
844+
lvaTable[varNum].lvIsStructField = false;
844845
}
845846
}
846847
else
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Runtime.CompilerServices;
8+
9+
class Program
10+
{
11+
static int Main()
12+
{
13+
var map = new Dictionary<string, bool?> { { "foo", true } };
14+
return (Test(map) == true) ? 100 : 1;
15+
}
16+
17+
[MethodImpl(MethodImplOptions.NoInlining)]
18+
static bool? Test(Dictionary<string, bool?> map)
19+
{
20+
return map["foo"];
21+
}
22+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
8+
<ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
9+
<OutputType>Exe</OutputType>
10+
<FileAlignment>512</FileAlignment>
11+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
12+
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
13+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
14+
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
15+
</PropertyGroup>
16+
<!-- Default configurations to help VS understand the configurations -->
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
19+
<PropertyGroup>
20+
<DebugType></DebugType>
21+
<Optimize>True</Optimize>
22+
</PropertyGroup>
23+
<ItemGroup>
24+
<Compile Include="GitHub_15718.cs" />
25+
</ItemGroup>
26+
<ItemGroup>
27+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
28+
</ItemGroup>
29+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
30+
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
31+
</Project>

0 commit comments

Comments
 (0)