Merge pull request #6791 from hvitved/csharp/update-nuget-packages

C#: Update nuget packages
This commit is contained in:
Tom Hvitved 2021-12-14 10:20:15 +01:00 коммит произвёл GitHub
Родитель 6fda5e8f5b 26194be8b6
Коммит 37d76f5e49
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
25 изменённых файлов: 292 добавлений и 311 удалений

Просмотреть файл

@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.9.0" />
<PackageReference Include="Microsoft.Build" Version="16.11.0" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,25 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Autobuild.CSharp\Semmle.Autobuild.CSharp.csproj" />
<ProjectReference Include="..\Semmle.Autobuild.Shared\Semmle.Autobuild.Shared.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.FileSystem" Version="4.3.0"/>
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0"/>
<PackageReference Include="xunit" Version="2.4.1"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Autobuild.CSharp\Semmle.Autobuild.CSharp.csproj"/>
<ProjectReference Include="..\Semmle.Autobuild.Shared\Semmle.Autobuild.Shared.csproj"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,30 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Autobuild.CSharp</AssemblyName>
<RootNamespace>Semmle.Autobuild.CSharp</RootNamespace>
<ApplicationIcon />
<OutputType>Exe</OutputType>
<StartupObject />
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extractor\Semmle.Util\Semmle.Util.csproj" />
<ProjectReference Include="..\..\extractor\Semmle.Extraction.CSharp\Semmle.Extraction.CSharp.csproj" />
<ProjectReference Include="..\Semmle.Autobuild.Shared\Semmle.Autobuild.Shared.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Autobuild.CSharp</AssemblyName>
<RootNamespace>Semmle.Autobuild.CSharp</RootNamespace>
<ApplicationIcon/>
<OutputType>Exe</OutputType>
<StartupObject/>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.11.0"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extractor\Semmle.Util\Semmle.Util.csproj"/>
<ProjectReference Include="..\..\extractor\Semmle.Extraction.CSharp\Semmle.Extraction.CSharp.csproj"/>
<ProjectReference Include="..\Semmle.Autobuild.Shared\Semmle.Autobuild.Shared.csproj"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,24 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Autobuild.Shared</AssemblyName>
<RootNamespace>Semmle.Autobuild.Shared</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extractor\Semmle.Util\Semmle.Util.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Autobuild.Shared</AssemblyName>
<RootNamespace>Semmle.Autobuild.Shared</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.11.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extractor\Semmle.Util\Semmle.Util.csproj"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -26,7 +26,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.DiaSymReader" Version="1.3.0" />
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="1.7.0" />
<PackageReference Include="Microsoft.DiaSymReader.PortablePdb" Version="1.5.0" />
<PackageReference Include="Microsoft.DiaSymReader.PortablePdb" Version="1.6.0"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,33 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Extraction.CSharp.Standalone</AssemblyName>
<RootNamespace>Semmle.Extraction.CSharp.Standalone</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningsAsErrors />
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Extraction.CSharp\Semmle.Extraction.CSharp.csproj" />
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.9.0" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
<PackageReference Include="System.Net.Primitives" Version="4.3.1" />
<PackageReference Include="System.Security.Principal" Version="4.3.0" />
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Extraction.CSharp.Standalone</AssemblyName>
<RootNamespace>Semmle.Extraction.CSharp.Standalone</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningsAsErrors/>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Extraction.CSharp\Semmle.Extraction.CSharp.csproj"/>
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.11.0"/>
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0"/>
<PackageReference Include="System.Net.Primitives" Version="4.3.1"/>
<PackageReference Include="System.Security.Principal" Version="4.3.0"/>
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -18,6 +18,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
private void VisitParameter(ParameterSyntax p)
{
var symbol = Context.GetModel(p).GetDeclaredSymbol(p)!;
Context.CacheLambdaParameterSymbol(symbol, p);
Parameter.Create(Context, symbol, this);
}

Просмотреть файл

@ -55,11 +55,17 @@ namespace Semmle.Extraction.CSharp.Entities
}
}
public static Parameter Create(Context cx, IParameterSymbol param, IEntity parent, Parameter? original = null) =>
ParameterFactory.Instance.CreateEntity(cx, param, (param, parent, original));
public static Parameter Create(Context cx, IParameterSymbol param, IEntity parent, Parameter? original = null)
{
var cachedSymbol = cx.GetPossiblyCachedParameterSymbol(param);
return ParameterFactory.Instance.CreateEntity(cx, cachedSymbol, (cachedSymbol, parent, original));
}
public static Parameter Create(Context cx, IParameterSymbol param) =>
ParameterFactory.Instance.CreateEntity(cx, param, (param, null, null));
public static Parameter Create(Context cx, IParameterSymbol param)
{
var cachedSymbol = cx.GetPossiblyCachedParameterSymbol(param);
return ParameterFactory.Instance.CreateEntity(cx, cachedSymbol, (cachedSymbol, null, null));
}
public override void WriteId(EscapingTextWriter trapFile)
{

Просмотреть файл

@ -18,18 +18,56 @@ namespace Semmle.Extraction.CSharp
/// </summary>
public SemanticModel GetModel(SyntaxNode node)
{
// todo: when this context belongs to a SourceScope, the syntax tree can be retrieved from the scope, and
// the node parameter could be removed. Is there any case when we pass in a node that's not from the current
// tree?
if (cachedModel is null || node.SyntaxTree != cachedModel.SyntaxTree)
if (node.SyntaxTree == SourceTree)
{
cachedModel = Compilation.GetSemanticModel(node.SyntaxTree);
if (cachedModelForTree is null)
{
cachedModelForTree = Compilation.GetSemanticModel(node.SyntaxTree);
}
return cachedModelForTree;
}
return cachedModel;
if (cachedModelForOtherTrees is null || node.SyntaxTree != cachedModelForOtherTrees.SyntaxTree)
{
cachedModelForOtherTrees = Compilation.GetSemanticModel(node.SyntaxTree);
}
return cachedModelForOtherTrees;
}
private SemanticModel? cachedModel;
private SemanticModel? cachedModelForTree;
private SemanticModel? cachedModelForOtherTrees;
// The below is a workaround to the bug reported in https://github.com/dotnet/roslyn/issues/58226
// Lambda parameters that are equal according to `SymbolEqualityComparer.Default`, might have different
// hash-codes, and as a result might not be found in `symbolEntityCache` by hash-code lookup.
internal IParameterSymbol GetPossiblyCachedParameterSymbol(IParameterSymbol param)
{
if ((param.ContainingSymbol as IMethodSymbol)?.MethodKind != MethodKind.AnonymousFunction)
{
return param;
}
foreach (var sr in param.DeclaringSyntaxReferences)
{
var syntax = sr.GetSyntax();
if (lambdaParameterCache.TryGetValue(syntax, out var cached) &&
SymbolEqualityComparer.Default.Equals(param, cached))
{
return cached;
}
}
return param;
}
internal void CacheLambdaParameterSymbol(IParameterSymbol param, SyntaxNode syntax)
{
lambdaParameterCache[syntax] = param;
}
private readonly Dictionary<SyntaxNode, IParameterSymbol> lambdaParameterCache = new Dictionary<SyntaxNode, IParameterSymbol>();
/// <summary>
/// The current compilation unit.

Просмотреть файл

@ -1,29 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Extraction.CSharp</AssemblyName>
<RootNamespace>Semmle.Extraction.CSharp</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Extraction.CIL\Semmle.Extraction.CIL.csproj" />
<ProjectReference Include="..\Semmle.Extraction\Semmle.Extraction.csproj" />
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.9.0" />
<PackageReference Include="Microsoft.Build" Version="16.9.0" />
</ItemGroup>
</Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Extraction.CSharp</AssemblyName>
<RootNamespace>Semmle.Extraction.CSharp</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Extraction.CIL\Semmle.Extraction.CIL.csproj"/>
<ProjectReference Include="..\Semmle.Extraction\Semmle.Extraction.csproj"/>
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1"/>
<PackageReference Include="Microsoft.Build" Version="16.11.0"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,28 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Extraction.CSharp.Standalone\Semmle.Extraction.CSharp.Standalone.csproj" />
<ProjectReference Include="..\Semmle.Extraction.CSharp\Semmle.Extraction.CSharp.csproj" />
<ProjectReference Include="..\Semmle.Extraction\Semmle.Extraction.csproj" />
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.FileSystem" Version="4.3.0"/>
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0"/>
<PackageReference Include="xunit" Version="2.4.1"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Extraction.CSharp.Standalone\Semmle.Extraction.CSharp.Standalone.csproj"/>
<ProjectReference Include="..\Semmle.Extraction.CSharp\Semmle.Extraction.CSharp.csproj"/>
<ProjectReference Include="..\Semmle.Extraction\Semmle.Extraction.csproj"/>
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,29 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Extraction</AssemblyName>
<RootNamespace>Semmle.Extraction</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CodeAnalysisRuleSet>Semmle.Extraction.ruleset</CodeAnalysisRuleSet>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;DEBUG_LABELS</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.9.0" />
<PackageReference Include="GitInfo" Version="2.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Semmle.Extraction</AssemblyName>
<RootNamespace>Semmle.Extraction</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CodeAnalysisRuleSet>Semmle.Extraction.ruleset</CodeAnalysisRuleSet>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;DEBUG_LABELS</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1"/>
<PackageReference Include="GitInfo" Version="2.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,23 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semmle.Util\Semmle.Util.csproj"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -75,7 +75,7 @@ class BlockStmt extends Stmt, @block_stmt {
/** Holds if this block is the container of the global statements. */
predicate isGlobalStatementContainer() {
this.getEnclosingCallable().hasQualifiedName("<Program>$.<Main>$")
this.getEnclosingCallable().hasQualifiedName("Program.<Main>$")
}
override Stmt stripSingletonBlocks() {

Просмотреть файл

@ -8,7 +8,7 @@ class MainMethod extends Method {
(
this.hasName("Main")
or
this.hasQualifiedName("<Program>$", "<Main>$")
this.hasQualifiedName("Program.<Main>$")
) and
this.isStatic() and
(this.getReturnType() instanceof VoidType or this.getReturnType() instanceof IntType) and

Просмотреть файл

@ -299,7 +299,7 @@ expressionTypes
| NullableRefTypes.cs:93:21:93:28 | "source" | string! |
| NullableRefTypes.cs:94:13:94:13 | access to local variable y | string? |
| NullableRefTypes.cs:94:13:94:25 | String y = ... | string? |
| NullableRefTypes.cs:94:17:94:17 | access to local variable x | string! |
| NullableRefTypes.cs:94:17:94:17 | access to local variable x | string? |
| NullableRefTypes.cs:94:17:94:25 | ... ?? ... | string? |
| NullableRefTypes.cs:94:22:94:25 | null | null |
| NullableRefTypes.cs:95:16:95:16 | access to local variable z | string! |

Просмотреть файл

@ -9,6 +9,7 @@ type
| file://:0:0:0:0 | delegate* default<T,Int32> | int | DefaultCallingConvention |
| file://:0:0:0:0 | delegate* default<Void*,Int32*> | int* | DefaultCallingConvention |
| file://:0:0:0:0 | delegate* stdcall<Int32 ref,Object out,T,Void> | Void | StdCallCallingConvention |
| file://:0:0:0:0 | delegate* unmanaged<Char*,IntPtr,Void> | Void | CallingConvention |
unmanagedCallingConvention
parameter
| file://:0:0:0:0 | delegate* default<A,B> | 0 | file://:0:0:0:0 | | A |
@ -27,6 +28,8 @@ parameter
| file://:0:0:0:0 | delegate* stdcall<Int32 ref,Object out,T,Void> | 0 | file://:0:0:0:0 | | ref int! |
| file://:0:0:0:0 | delegate* stdcall<Int32 ref,Object out,T,Void> | 1 | file://:0:0:0:0 | `1 | out object? |
| file://:0:0:0:0 | delegate* stdcall<Int32 ref,Object out,T,Void> | 2 | file://:0:0:0:0 | `2 | T |
| file://:0:0:0:0 | delegate* unmanaged<Char*,IntPtr,Void> | 0 | file://:0:0:0:0 | | char*! |
| file://:0:0:0:0 | delegate* unmanaged<Char*,IntPtr,Void> | 1 | file://:0:0:0:0 | `1 | IntPtr! |
invocation
| FunctionPointer.cs:17:21:17:43 | function pointer call |
| FunctionPointer.cs:23:13:23:44 | function pointer call |

Просмотреть файл

@ -1,7 +1,6 @@
noBody
| LocalFunction.cs:16:9:16:41 | localExtern |
localFunctionModifier
| GlobalStmt.cs:13:1:15:1 | M | private |
| LambdaModifier.cs:8:9:8:36 | m | private |
| LocalFunction.cs:9:9:12:9 | mul | async |
| LocalFunction.cs:9:9:12:9 | mul | private |

Просмотреть файл

@ -404,39 +404,6 @@ FunctionPointer.cs:
# 48| 14: [Class] B
#-----| 3: (Base types)
# 48| 0: [TypeMention] A
GlobalStmt.cs:
# 5| [Class] <Program>$
# 5| 4: [Method] <Main>$
#-----| 2: (Parameters)
# 1| 0: [Parameter] args
# 5| 4: [BlockStmt] {...}
# 9| 0: [ExprStmt] ...;
# 9| 0: [MethodCall] call to method WriteLine
# 9| -1: [TypeAccess] access to type Console
# 9| 0: [TypeMention] Console
# 9| 0: [StringLiteral] "1"
# 10| 1: [ExprStmt] ...;
# 10| 0: [MethodCall] call to method WriteLine
# 10| -1: [TypeAccess] access to type Console
# 10| 0: [TypeMention] Console
# 10| 0: [StringLiteral] "2"
# 11| 2: [ExprStmt] ...;
# 11| 0: [LocalFunctionCall] call to local function M
# 11| -1: [LocalFunctionAccess] access to local function M
# 13| 3: [LocalFunctionStmt] M(...)
# 13| 0: [LocalFunction] M
# 14| 4: [BlockStmt] {...}
# 17| [Class] Attr
#-----| 3: (Base types)
# 17| 0: [TypeMention] Attribute
# 19| 5: [Method] M1
# 19| -1: [TypeMention] Void
# 20| 4: [BlockStmt] {...}
# 21| 0: [ExprStmt] ...;
# 21| 0: [MethodCall] call to method WriteLine
# 21| -1: [TypeAccess] access to type Console
# 21| 0: [TypeMention] Console
# 21| 0: [StringLiteral] "3"
InitOnlyProperty.cs:
# 3| [Class] Base
# 5| 5: [Property] Prop0
@ -812,12 +779,12 @@ Record.cs:
# 4| [Record] Person
# 4| 11: [NEOperator] !=
#-----| 2: (Parameters)
# 4| 0: [Parameter] r1
# 4| 1: [Parameter] r2
# 4| 0: [Parameter] left
# 4| 1: [Parameter] right
# 4| 12: [EQOperator] ==
#-----| 2: (Parameters)
# 4| 0: [Parameter] r1
# 4| 1: [Parameter] r2
# 4| 0: [Parameter] left
# 4| 1: [Parameter] right
# 4| 13: [Property] EqualityContract
# 4| 3: [Getter] get_EqualityContract
# 6| 14: [Property] LastName
@ -842,12 +809,12 @@ Record.cs:
# 12| [Record] Teacher
# 12| 12: [NEOperator] !=
#-----| 2: (Parameters)
# 12| 0: [Parameter] r1
# 12| 1: [Parameter] r2
# 12| 0: [Parameter] left
# 12| 1: [Parameter] right
# 12| 13: [EQOperator] ==
#-----| 2: (Parameters)
# 12| 0: [Parameter] r1
# 12| 1: [Parameter] r2
# 12| 0: [Parameter] left
# 12| 1: [Parameter] right
# 12| 14: [Property] EqualityContract
# 12| 3: [Getter] get_EqualityContract
# 14| 15: [Property] Subject
@ -870,12 +837,12 @@ Record.cs:
# 20| [Record] Student
# 20| 12: [NEOperator] !=
#-----| 2: (Parameters)
# 20| 0: [Parameter] r1
# 20| 1: [Parameter] r2
# 20| 0: [Parameter] left
# 20| 1: [Parameter] right
# 20| 13: [EQOperator] ==
#-----| 2: (Parameters)
# 20| 0: [Parameter] r1
# 20| 1: [Parameter] r2
# 20| 0: [Parameter] left
# 20| 1: [Parameter] right
# 20| 14: [Property] EqualityContract
# 20| 3: [Getter] get_EqualityContract
# 22| 15: [Property] Level
@ -898,12 +865,12 @@ Record.cs:
# 27| [Record] Person1
# 27| 12: [NEOperator] !=
#-----| 2: (Parameters)
# 27| 0: [Parameter] r1
# 27| 1: [Parameter] r2
# 27| 0: [Parameter] left
# 27| 1: [Parameter] right
# 27| 13: [EQOperator] ==
#-----| 2: (Parameters)
# 27| 0: [Parameter] r1
# 27| 1: [Parameter] r2
# 27| 0: [Parameter] left
# 27| 1: [Parameter] right
# 27| 14: [Property] EqualityContract
# 27| 3: [Getter] get_EqualityContract
# 27| 15: [InstanceConstructor] Person1
@ -925,12 +892,12 @@ Record.cs:
# 29| [Record] Teacher1
# 29| 13: [NEOperator] !=
#-----| 2: (Parameters)
# 29| 0: [Parameter] r1
# 29| 1: [Parameter] r2
# 29| 0: [Parameter] left
# 29| 1: [Parameter] right
# 29| 14: [EQOperator] ==
#-----| 2: (Parameters)
# 29| 0: [Parameter] r1
# 29| 1: [Parameter] r2
# 29| 0: [Parameter] left
# 29| 1: [Parameter] right
# 29| 15: [Property] EqualityContract
# 29| 3: [Getter] get_EqualityContract
# 29| 16: [InstanceConstructor] Teacher1
@ -949,12 +916,12 @@ Record.cs:
# 32| [Record] Student1
# 32| 13: [NEOperator] !=
#-----| 2: (Parameters)
# 32| 0: [Parameter] r1
# 32| 1: [Parameter] r2
# 32| 0: [Parameter] left
# 32| 1: [Parameter] right
# 32| 14: [EQOperator] ==
#-----| 2: (Parameters)
# 32| 0: [Parameter] r1
# 32| 1: [Parameter] r2
# 32| 0: [Parameter] left
# 32| 1: [Parameter] right
# 32| 15: [Property] EqualityContract
# 32| 3: [Getter] get_EqualityContract
# 32| 16: [InstanceConstructor] Student1
@ -973,12 +940,12 @@ Record.cs:
# 35| [Record] Pet
# 35| 12: [NEOperator] !=
#-----| 2: (Parameters)
# 35| 0: [Parameter] r1
# 35| 1: [Parameter] r2
# 35| 0: [Parameter] left
# 35| 1: [Parameter] right
# 35| 13: [EQOperator] ==
#-----| 2: (Parameters)
# 35| 0: [Parameter] r1
# 35| 1: [Parameter] r2
# 35| 0: [Parameter] left
# 35| 1: [Parameter] right
# 35| 14: [Property] EqualityContract
# 35| 3: [Getter] get_EqualityContract
# 35| 15: [InstanceConstructor] Pet
@ -999,12 +966,12 @@ Record.cs:
# 41| [Record] Dog
# 41| 12: [NEOperator] !=
#-----| 2: (Parameters)
# 41| 0: [Parameter] r1
# 41| 1: [Parameter] r2
# 41| 0: [Parameter] left
# 41| 1: [Parameter] right
# 41| 13: [EQOperator] ==
#-----| 2: (Parameters)
# 41| 0: [Parameter] r1
# 41| 1: [Parameter] r2
# 41| 0: [Parameter] left
# 41| 1: [Parameter] right
# 41| 14: [InstanceConstructor] Dog
#-----| 2: (Parameters)
# 41| 0: [Parameter] Name
@ -1038,12 +1005,12 @@ Record.cs:
# 54| [Record] R1
# 54| 12: [NEOperator] !=
#-----| 2: (Parameters)
# 54| 0: [Parameter] r1
# 54| 1: [Parameter] r2
# 54| 0: [Parameter] left
# 54| 1: [Parameter] right
# 54| 13: [EQOperator] ==
#-----| 2: (Parameters)
# 54| 0: [Parameter] r1
# 54| 1: [Parameter] r2
# 54| 0: [Parameter] left
# 54| 1: [Parameter] right
# 54| 14: [Property] EqualityContract
# 54| 3: [Getter] get_EqualityContract
# 54| 15: [InstanceConstructor] R1
@ -1058,12 +1025,12 @@ Record.cs:
# 56| [Record] R2
# 56| 13: [NEOperator] !=
#-----| 2: (Parameters)
# 56| 0: [Parameter] r1
# 56| 1: [Parameter] r2
# 56| 0: [Parameter] left
# 56| 1: [Parameter] right
# 56| 14: [EQOperator] ==
#-----| 2: (Parameters)
# 56| 0: [Parameter] r1
# 56| 1: [Parameter] r2
# 56| 0: [Parameter] left
# 56| 1: [Parameter] right
# 56| 15: [Property] EqualityContract
# 56| 3: [Getter] get_EqualityContract
# 56| 16: [InstanceConstructor] R2

Просмотреть файл

@ -4,7 +4,7 @@ global_stmt
| GlobalStmt.cs:11:1:11:4 | ...; |
| GlobalStmt.cs:13:1:15:1 | M(...) |
globalBlock
| GlobalStmt.cs:5:1:24:0 | {...} | GlobalStmt.cs:5:1:24:0 | <Main>$ | GlobalStmt.cs:1:1:1:0 | args | GlobalStmt.cs:5:1:24:0 | <Program>$ |
| GlobalStmt.cs:5:1:24:0 | {...} | GlobalStmt.cs:5:1:24:0 | <Main>$ | GlobalStmt.cs:1:1:1:0 | args | GlobalStmt.cs:5:1:24:0 | Program |
methods
| GlobalStmt.cs:5:1:24:0 | <Main>$ | entry |
| GlobalStmt.cs:19:8:19:9 | M1 | non-entry |

Просмотреть файл

@ -0,0 +1 @@
semmle-extractor-options: --standalone

Просмотреть файл

@ -1 +1 @@
semmle-extractor-options: --standalone
semmle-extractor-options: /r:System.Linq.dll

Просмотреть файл

@ -284,12 +284,12 @@ Tuples.cs:
# 85| 9: [Record] R1
# 85| 12: [NEOperator] !=
#-----| 2: (Parameters)
# 85| 0: [Parameter] r1
# 85| 1: [Parameter] r2
# 85| 0: [Parameter] left
# 85| 1: [Parameter] right
# 85| 13: [EQOperator] ==
#-----| 2: (Parameters)
# 85| 0: [Parameter] r1
# 85| 1: [Parameter] r2
# 85| 0: [Parameter] left
# 85| 1: [Parameter] right
# 85| 14: [Property] EqualityContract
# 85| 3: [Getter] get_EqualityContract
# 85| 15: [InstanceConstructor] R1