未验证 提交 a213194a 编写于 作者: J Jason Malinowski 提交者: GitHub

Merge pull request #24107 from dotnet/master

Snap master into dev15.6.x
......@@ -141,7 +141,7 @@
<NuGetVisualStudioVersion>4.0.0-rc-2048</NuGetVisualStudioVersion>
<NuSpecReferenceGeneratorVersion>1.4.2</NuSpecReferenceGeneratorVersion>
<OctokitVersion>0.23.0</OctokitVersion>
<Pdb2PdbVersion>1.1.0-beta1-62301-01</Pdb2PdbVersion>
<MicrosoftDiaSymReaderPdb2PdbVersion>1.1.0-beta1-62506-02</MicrosoftDiaSymReaderPdb2PdbVersion>
<RestSharpVersion>105.2.3</RestSharpVersion>
<RoslynBuildUtilVersion>0.9.8-beta</RoslynBuildUtilVersion>
<RoslynDependenciesOptimizationDataVersion>2.6.0-beta1-62205-01</RoslynDependenciesOptimizationDataVersion>
......
......@@ -59,7 +59,7 @@ Update this file only if the change to RepoToolset gets approved and merged.
Condition="'$(PublishOutputToSymStore)' == 'true' and ('$(DebugType)' == 'portable' or '$(DebugType)' == 'embedded')">
<PropertyGroup>
<_PdbConverterPath>$(NuGetPackageRoot)pdb2pdb\$(Pdb2PdbVersion)\tools\Pdb2Pdb.exe</_PdbConverterPath>
<_PdbConverterPath>$(NuGetPackageRoot)microsoft.diasymreader.pdb2pdb\$(MicrosoftDiaSymReaderPdb2PdbVersion)\tools\Pdb2Pdb.exe</_PdbConverterPath>
<_PdbConverterCommandLineArgs>"$(TargetPath)" /out "$(_SymStorePdbPath)" /verbose</_PdbConverterCommandLineArgs>
</PropertyGroup>
......
......@@ -40,15 +40,14 @@
<_RelativePath>$([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectDirectory)))</_RelativePath>
<!-- TODO: Proper URL escaping -->
<_RawUrl>$(RepositoryRawUrl)/$(GitHeadSha)/$(_RelativePath.Replace('\', '/'))</_RawUrl>
<_RawUrl>$(RepositoryRawUrl)/$(GitHeadSha)/$(_RelativePath.Replace('\', '/'))/*</_RawUrl>
<_Content>
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<SourceRoot Include="%24([System.IO.Path]::GetFullPath('%24(MSBuildThisFileDirectory)..\contentFiles\cs\%24(TargetFramework)\'))"
RawUrl="$(_RawUrl)"
UniqueName="%24(MSBuildThisFileName)"/>
SourceLinkUrl="$(_RawUrl)"/>
</ItemGroup>
</Project>]]>
</_Content>
......
......@@ -17,7 +17,7 @@
<PackageReference Include="xunit.analyzers" Version="$(xunitanalyzersVersion)" ExcludeAssets="all" />
<PackageReference Include="xunit.runner.console" Version="$(xunitrunnerconsoleVersion)" ExcludeAssets="all" />
<PackageReference Include="RoslynTools.ReferenceAssemblies" Version="$(RoslynToolsReferenceAssembliesVersion)" ExcludeAssets="all" />
<PackageReference Include="pdb2pdb" Version="$(Pdb2PdbVersion)" ExcludeAssets="all" />
<PackageReference Include="Microsoft.DiaSymReader.Pdb2Pdb" Version="$(MicrosoftDiaSymReaderPdb2PdbVersion)" ExcludeAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="FakeSign" Version="$(FakeSignVersion)" ExcludeAssets="all" />
......
......@@ -331,6 +331,11 @@ private static string GetNextMethodName(ArrayBuilder<MethodSymbol> builder)
_currentFrame,
sourceAssembly,
alias);
// Skip pseudo-variables with errors.
if (local.GetUseSiteDiagnostic()?.Severity == DiagnosticSeverity.Error)
{
continue;
}
var methodName = GetNextMethodName(methodBuilder);
var syntax = SyntaxFactory.IdentifierName(SyntaxFactory.MissingToken(SyntaxKind.IdentifierToken));
var aliasMethod = this.CreateMethod(
......
......@@ -3848,6 +3848,46 @@ static void DummySequencePoint()
});
}
/// <summary>
/// CompileGetLocals should skip locals with errors.
/// </summary>
[WorkItem(535899, "https://devdiv.visualstudio.com/DevDiv/_workitems?id=535899")]
[Fact]
public void SkipPseudoVariablesWithUseSiteErrors()
{
var source =
@"class C
{
static void M(object x)
{
object y;
}
}";
var compilation0 = CreateStandardCompilation(source, options: TestOptions.DebugDll);
WithRuntimeInstance(compilation0, runtime =>
{
var context = CreateMethodContext(runtime, "C.M");
var aliases = ImmutableArray.Create(ReturnValueAlias(1, "UnknownType, UnknownAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
var locals = ArrayBuilder<LocalAndMethod>.GetInstance();
string typeName;
var diagnostics = DiagnosticBag.GetInstance();
var testData = new CompilationTestData();
context.CompileGetLocals(
locals,
argumentsOnly: false,
aliases: aliases,
diagnostics: diagnostics,
typeName: out typeName,
testData: testData);
diagnostics.Verify();
diagnostics.Free();
Assert.Equal(locals.Count, 2);
VerifyLocal(testData, typeName, locals[0], "<>m0", "x");
VerifyLocal(testData, typeName, locals[1], "<>m1", "y");
locals.Free();
});
}
private static void GetLocals(RuntimeInstance runtime, string methodName, bool argumentsOnly, ArrayBuilder<LocalAndMethod> locals, int count, out string typeName, out CompilationTestData testData)
{
var context = CreateMethodContext(runtime, methodName);
......
......@@ -242,6 +242,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
Dim methodName = GetNextMethodName(methodBuilder)
Dim syntax = SyntaxFactory.IdentifierName(SyntaxFactory.MissingToken(SyntaxKind.IdentifierToken))
Dim local = PlaceholderLocalSymbol.Create(typeNameDecoder, _currentFrame, [alias])
' Skip pseudo-variables with errors.
If local.GetUseSiteErrorInfo()?.Severity = DiagnosticSeverity.Error Then
Continue For
End If
Dim aliasMethod = Me.CreateMethod(
container,
methodName,
......
......@@ -3284,6 +3284,43 @@ End Class"
End Sub)
End Sub
''' <summary>
''' CompileGetLocals should skip locals with errors.
''' </summary>
<WorkItem(535899, "https://devdiv.visualstudio.com/DevDiv/_workitems?id=535899")>
<Fact>
Public Sub SkipPseudoVariablesWithUseSiteErrors()
Const source =
"Class C
Shared Sub M(x As Object)
Dim y As Object
End Sub
End Class"
Dim comp = CreateCompilationWithMscorlib({source}, options:=TestOptions.DebugDll)
WithRuntimeInstance(comp,
Sub(runtime)
Dim context = CreateMethodContext(runtime, "C.M")
Dim aliases = ImmutableArray.Create(ReturnValueAlias(1, "UnknownType, UnknownAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"))
Dim locals = ArrayBuilder(Of LocalAndMethod).GetInstance()
Dim typeName As String = Nothing
Dim diagnostics = DiagnosticBag.GetInstance()
Dim testData = New CompilationTestData()
context.CompileGetLocals(
locals,
argumentsOnly:=False,
aliases:=aliases,
diagnostics:=diagnostics,
typeName:=typeName,
testData:=testData)
diagnostics.Verify()
diagnostics.Free()
Assert.Equal(2, locals.Count)
VerifyLocal(testData, typeName, locals(0), "<>m0", "x")
VerifyLocal(testData, typeName, locals(1), "<>m1", "y")
locals.Free()
End Sub)
End Sub
Private Shared Sub GetLocals(runtime As RuntimeInstance, methodName As String, argumentsOnly As Boolean, locals As ArrayBuilder(Of LocalAndMethod), count As Integer, ByRef typeName As String, ByRef testData As CompilationTestData)
Dim context = CreateMethodContext(runtime, methodName)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册