Merge branch 'main' into ignore-non-type-template-params

This commit is contained in:
Mathias Vorreiter Pedersen
2025-11-25 15:37:25 +00:00
committed by GitHub
100 changed files with 14952 additions and 2105 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
description: Add databaseMetadata and overlayChangedFiles relations
compatibility: full
databaseMetadata.rel: delete
overlayChangedFiles.rel: delete

View File

@@ -21,3 +21,4 @@ dataExtensions:
- ext/deallocation/*.model.yml
- ext/allocation/*.model.yml
warnOnImplicitThis: true
compileForOverlayEval: true

View File

@@ -2078,38 +2078,151 @@ predicate localExprFlow(Expr e1, Expr e2) {
localExprFlowPlus(e1, e2)
}
/**
* A canonical representation of a field.
*
* For performance reasons we want a unique `Content` that represents
* a given field across any template instantiation of a class.
*
* This is possible in _almost_ all cases, but there are cases where it is
* not possible to map between a field in the uninstantiated template to a
* field in the instantiated template. This happens in the case of local class
* definitions (because the local class is not the template that constructs
* the instantiation - it is the enclosing function). So this abstract class
* has two implementations: a non-local case (where we can represent a
* canonical field as the field declaration from an uninstantiated class
* template or a non-templated class), and a local case (where we simply use
* the field from the instantiated class).
*/
abstract private class CanonicalField extends Field {
/** Gets a field represented by this canonical field. */
abstract Field getAField();
/**
* Gets a class that declares a field represented by this canonical field.
*/
abstract Class getADeclaringType();
/**
* Gets a type that this canonical field may have. Note that this may
* not be a unique type. For example, consider this case:
* ```
* template<typename T>
* struct S { T x; };
*
* S<int> s1;
* S<char> s2;
* ```
* In this case the canonical field corresponding to `S::x` has two types:
* `int` and `char`.
*/
Type getAType() { result = this.getAField().getType() }
Type getAnUnspecifiedType() { result = this.getAType().getUnspecifiedType() }
}
private class NonLocalCanonicalField extends CanonicalField {
Class declaringType;
NonLocalCanonicalField() {
declaringType = this.getDeclaringType() and
not declaringType.isFromTemplateInstantiation(_) and
not declaringType.isLocal() // handled in LocalCanonicalField
}
override Field getAField() {
exists(Class c | result.getDeclaringType() = c |
// Either the declaring class of the field is a template instantiation
// that has been constructed from this canonical declaration
c.isConstructedFrom(declaringType) and
pragma[only_bind_out](result.getName()) = pragma[only_bind_out](this.getName())
or
// or this canonical declaration is not a template.
not c.isConstructedFrom(_) and
result = this
)
}
override Class getADeclaringType() {
result = this.getDeclaringType()
or
result.isConstructedFrom(this.getDeclaringType())
}
}
private class LocalCanonicalField extends CanonicalField {
Class declaringType;
LocalCanonicalField() {
declaringType = this.getDeclaringType() and
declaringType.isLocal()
}
override Field getAField() { result = this }
override Class getADeclaringType() { result = declaringType }
}
/**
* A canonical representation of a `Union`. See `CanonicalField` for the explanation for
* why we need a canonical representation.
*/
abstract private class CanonicalUnion extends Union {
/** Gets a union represented by this canonical union. */
abstract Union getAUnion();
/** Gets a canonical field of this canonical union. */
CanonicalField getACanonicalField() { result.getDeclaringType() = this }
}
private class NonLocalCanonicalUnion extends CanonicalUnion {
NonLocalCanonicalUnion() { not this.isFromTemplateInstantiation(_) and not this.isLocal() }
override Union getAUnion() {
result = this
or
result.isConstructedFrom(this)
}
}
private class LocalCanonicalUnion extends CanonicalUnion {
LocalCanonicalUnion() { this.isLocal() }
override Union getAUnion() { result = this }
}
bindingset[f]
pragma[inline_late]
private int getFieldSize(Field f) { result = f.getType().getSize() }
private int getFieldSize(CanonicalField f) { result = max(f.getAType().getSize()) }
/**
* Gets a field in the union `u` whose size
* is `bytes` number of bytes.
*/
private Field getAFieldWithSize(Union u, int bytes) {
result = u.getAField() and
private CanonicalField getAFieldWithSize(CanonicalUnion u, int bytes) {
result = u.getACanonicalField() and
bytes = getFieldSize(result)
}
cached
private newtype TContent =
TNonUnionContent(Field f, int indirectionIndex) {
TNonUnionContent(CanonicalField f, int indirectionIndex) {
// the indirection index for field content starts at 1 (because `TNonUnionContent` is thought of as
// the address of the field, `FieldAddress` in the IR).
indirectionIndex = [1 .. SsaImpl::getMaxIndirectionsForType(f.getUnspecifiedType())] and
indirectionIndex = [1 .. max(SsaImpl::getMaxIndirectionsForType(f.getAnUnspecifiedType()))] and
// Reads and writes of union fields are tracked using `UnionContent`.
not f.getDeclaringType() instanceof Union
} or
TUnionContent(Union u, int bytes, int indirectionIndex) {
exists(Field f |
f = u.getAField() and
TUnionContent(CanonicalUnion u, int bytes, int indirectionIndex) {
exists(CanonicalField f |
f = u.getACanonicalField() and
bytes = getFieldSize(f) and
// We key `UnionContent` by the union instead of its fields since a write to one
// field can be read by any read of the union's fields. Again, the indirection index
// is 1-based (because 0 is considered the address).
indirectionIndex =
[1 .. max(SsaImpl::getMaxIndirectionsForType(getAFieldWithSize(u, bytes)
.getUnspecifiedType())
.getAnUnspecifiedType())
)]
)
} or
@@ -2175,8 +2288,12 @@ class FieldContent extends Content, TFieldContent {
/**
* Gets the field associated with this `Content`, if a unique one exists.
*
* For fields from template instantiations this predicate may still return
* more than one field, but all the fields will be constructed from the same
* template.
*/
final Field getField() { result = unique( | | this.getAField()) }
Field getField() { none() } // overridden in subclasses
override int getIndirectionIndex() { none() } // overridden in subclasses
@@ -2187,32 +2304,33 @@ class FieldContent extends Content, TFieldContent {
/** A reference through a non-union instance field. */
class NonUnionFieldContent extends FieldContent, TNonUnionContent {
private Field f;
private CanonicalField f;
private int indirectionIndex;
NonUnionFieldContent() { this = TNonUnionContent(f, indirectionIndex) }
override string toString() { result = contentStars(this) + f.toString() }
override Field getAField() { result = f }
final override Field getField() { result = f.getAField() }
override Field getAField() { result = this.getField() }
/** Gets the indirection index of this `FieldContent`. */
override int getIndirectionIndex() { result = indirectionIndex }
override predicate impliesClearOf(Content c) {
exists(FieldContent fc |
fc = c and
fc.getField() = f and
exists(int i |
c = TNonUnionContent(f, i) and
// If `this` is `f` then `c` is cleared if it's of the
// form `*f`, `**f`, etc.
fc.getIndirectionIndex() >= indirectionIndex
i >= indirectionIndex
)
}
}
/** A reference through an instance field of a union. */
class UnionContent extends FieldContent, TUnionContent {
private Union u;
private CanonicalUnion u;
private int indirectionIndex;
private int bytes;
@@ -2220,24 +2338,31 @@ class UnionContent extends FieldContent, TUnionContent {
override string toString() { result = contentStars(this) + u.toString() }
final override Field getField() { result = unique( | | u.getACanonicalField()).getAField() }
/** Gets a field of the underlying union of this `UnionContent`, if any. */
override Field getAField() { result = u.getAField() and getFieldSize(result) = bytes }
override Field getAField() {
exists(CanonicalField cf |
cf = u.getACanonicalField() and
result = cf.getAField() and
getFieldSize(cf) = bytes
)
}
/** Gets the underlying union of this `UnionContent`. */
Union getUnion() { result = u }
Union getUnion() { result = u.getAUnion() }
/** Gets the indirection index of this `UnionContent`. */
override int getIndirectionIndex() { result = indirectionIndex }
override predicate impliesClearOf(Content c) {
exists(UnionContent uc |
uc = c and
uc.getUnion() = u and
exists(int i |
c = TUnionContent(u, _, i) and
// If `this` is `u` then `c` is cleared if it's of the
// form `*u`, `**u`, etc. (and we ignore `bytes` because
// we know the entire union is overwritten because it's a
// union).
uc.getIndirectionIndex() >= indirectionIndex
i >= indirectionIndex
)
}
}

View File

@@ -1,3 +1,4 @@
/*- Compilations -*/
/**
@@ -2378,6 +2379,24 @@ link_parent(
int link_target : @link_target ref
);
/**
* The CLI will automatically emit applicable tuples for this table,
* such as `databaseMetadata("isOverlay", "true")` when building an
* overlay database.
*/
databaseMetadata(
string metadataKey: string ref,
string value: string ref
);
/**
* The CLI will automatically emit tuples for each new/modified/deleted file
* when building an overlay database.
*/
overlayChangedFiles(
string path: string ref
);
/*- XML Files -*/
xmlEncoding(

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add databaseMetadata and overlayChangedFiles relations
compatibility: full

View File

@@ -142,6 +142,7 @@ postWithInFlow
| simple.cpp:92:7:92:7 | i [post update] | PostUpdateNode should not be the target of local flow. |
| simple.cpp:118:7:118:7 | i [post update] | PostUpdateNode should not be the target of local flow. |
| simple.cpp:124:5:124:6 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
| simple.cpp:167:9:167:9 | x [post update] | PostUpdateNode should not be the target of local flow. |
viableImplInCallContextTooLarge
uniqueParameterNodeAtPosition
uniqueParameterNodePosition

View File

@@ -308,3 +308,5 @@ WARNING: module 'DataFlow' has been deprecated and may be removed in future (par
| simple.cpp:124:5:124:6 | * ... | AST only |
| simple.cpp:131:14:131:14 | a | IR only |
| simple.cpp:136:10:136:10 | a | IR only |
| simple.cpp:167:9:167:9 | x | AST only |
| simple.cpp:168:8:168:12 | u_int | IR only |

View File

@@ -670,6 +670,8 @@
| simple.cpp:131:14:131:14 | a |
| simple.cpp:135:20:135:20 | q |
| simple.cpp:136:10:136:10 | a |
| simple.cpp:167:3:167:7 | u_int |
| simple.cpp:168:8:168:12 | u_int |
| struct_init.c:15:8:15:9 | ab |
| struct_init.c:15:12:15:12 | a |
| struct_init.c:16:8:16:9 | ab |

View File

@@ -597,6 +597,8 @@ WARNING: module 'DataFlow' has been deprecated and may be removed in future (par
| simple.cpp:118:7:118:7 | i |
| simple.cpp:124:5:124:6 | * ... |
| simple.cpp:135:20:135:20 | q |
| simple.cpp:167:3:167:7 | u_int |
| simple.cpp:167:9:167:9 | x |
| struct_init.c:15:8:15:9 | ab |
| struct_init.c:15:12:15:12 | a |
| struct_init.c:16:8:16:9 | ab |

View File

@@ -136,4 +136,36 @@ void alias_with_fields(bool b) {
sink(a.i); // $ MISSING: ast,ir
}
template<typename T>
union U_with_two_instantiations_of_different_size {
int x;
T y;
};
struct LargeStruct {
int data[64];
};
void test_union_with_two_instantiations_of_different_sizes() {
// A union's fields is partitioned into "chunks" for field-flow in order to
// improve performance (so that a write to a field of a union does not flow
// to too many reads that don't happen at runtime). The partitioning is based
// the size of the types in the union. So a write to a field of size k only
// flows to a read of size k.
// Since field-flow is based on uninstantiated types a field can have
// multiple sizes if the union is instantiated with types of
// different sizes. So to compute the partition we pick the maximum size.
// Because of this there are `Content`s corresponding to the union
// `U_with_two_instantiations_of_different_size<T>`: The one for size
// `sizeof(int)`, and the one for size `sizeof(LargeStruct)` (because
// `LargeStruct` is larger than `int`). So the write to `x` writes to the
// `Content` for size `sizeof(int)`, and the read of `y` reads from the
// `Content` for size `sizeof(LargeStruct)`.
U_with_two_instantiations_of_different_size<int> u_int;
U_with_two_instantiations_of_different_size<LargeStruct> u_very_large;
u_int.x = user_input();
sink(u_int.y); // $ MISSING: ir
}
} // namespace Simple

View File

@@ -2,10 +2,10 @@
| file://:0:0:0:0 | (unnamed parameter 0) | file://:0:0:0:0 | address && | SemanticStackVariable | | |
| file://:0:0:0:0 | (unnamed parameter 0) | file://:0:0:0:0 | const __va_list_tag & | SemanticStackVariable | | |
| file://:0:0:0:0 | (unnamed parameter 0) | file://:0:0:0:0 | const address & | SemanticStackVariable | | |
| file://:0:0:0:0 | fp_offset | file://:0:0:0:0 | unsigned int | Field | | |
| file://:0:0:0:0 | gp_offset | file://:0:0:0:0 | unsigned int | Field | | |
| file://:0:0:0:0 | overflow_arg_area | file://:0:0:0:0 | void * | Field | | |
| file://:0:0:0:0 | reg_save_area | file://:0:0:0:0 | void * | Field | | |
| file://:0:0:0:0 | fp_offset | file://:0:0:0:0 | unsigned int | NonLocalCanonicalField | | |
| file://:0:0:0:0 | gp_offset | file://:0:0:0:0 | unsigned int | NonLocalCanonicalField | | |
| file://:0:0:0:0 | overflow_arg_area | file://:0:0:0:0 | void * | NonLocalCanonicalField | | |
| file://:0:0:0:0 | reg_save_area | file://:0:0:0:0 | void * | NonLocalCanonicalField | | |
| variables.cpp:1:12:1:12 | i | file://:0:0:0:0 | int | GlobalLikeVariable, GlobalVariable, StaticStorageDurationVariable | | |
| variables.cpp:2:12:2:12 | i | file://:0:0:0:0 | int | GlobalLikeVariable, GlobalVariable, StaticStorageDurationVariable | | |
| variables.cpp:3:12:3:12 | i | file://:0:0:0:0 | int | GlobalLikeVariable, GlobalVariable, StaticStorageDurationVariable | | |
@@ -33,10 +33,10 @@
| variables.cpp:37:6:37:8 | ap3 | file://:0:0:0:0 | int * | GlobalLikeVariable, GlobalVariable, StaticStorageDurationVariable | | |
| variables.cpp:41:7:41:11 | local | file://:0:0:0:0 | char[] | LocalVariable, SemanticStackVariable | | |
| variables.cpp:43:14:43:18 | local | file://:0:0:0:0 | int | GlobalLikeVariable, StaticLocalVariable | | static |
| variables.cpp:48:9:48:12 | name | file://:0:0:0:0 | char * | Field | | |
| variables.cpp:49:12:49:17 | number | file://:0:0:0:0 | long | Field | | |
| variables.cpp:50:9:50:14 | street | file://:0:0:0:0 | char * | Field | | |
| variables.cpp:51:9:51:12 | town | file://:0:0:0:0 | char * | Field | | |
| variables.cpp:48:9:48:12 | name | file://:0:0:0:0 | char * | NonLocalCanonicalField | | |
| variables.cpp:49:12:49:17 | number | file://:0:0:0:0 | long | NonLocalCanonicalField | | |
| variables.cpp:50:9:50:14 | street | file://:0:0:0:0 | char * | NonLocalCanonicalField | | |
| variables.cpp:51:9:51:12 | town | file://:0:0:0:0 | char * | NonLocalCanonicalField | | |
| variables.cpp:52:16:52:22 | country | file://:0:0:0:0 | char * | MemberVariable, StaticStorageDurationVariable | | static |
| variables.cpp:56:14:56:29 | externInFunction | file://:0:0:0:0 | int | GlobalLikeVariable, GlobalVariable, StaticStorageDurationVariable | | |
| variables.cpp:60:10:60:17 | __func__ | file://:0:0:0:0 | const char[9] | GlobalLikeVariable, StaticInitializedStaticLocalVariable | | static |

View File

@@ -84,11 +84,7 @@ namespace Semmle.Autobuild.CSharp
var temp = FileUtils.GetTemporaryWorkingDirectory(builder.Actions.GetEnvironmentVariable, builder.Options.Language.UpperCaseName, out var shouldCleanUp);
return DotNet.WithDotNet(builder.Actions, builder.Logger, builder.Paths.Select(x => x.Item1), temp, shouldCleanUp, ensureDotNetAvailable, builder.Options.DotNetVersion, installDir =>
{
var env = new Dictionary<string, string>
{
{ "DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "true" },
{ "MSBUILDDISABLENODEREUSE", "1" }
};
var env = DotNet.MinimalEnvironment.ToDictionary();
if (installDir is not null)
{
// The installation succeeded, so use the newly installed .NET

View File

@@ -74,3 +74,8 @@ options:
[EXPERIMENTAL] The value is a path to the MsBuild binary log file that should be extracted.
This option only works when `--build-mode none` is also specified.
type: array
buildless_dependency_dir:
title: The path where buildless (standalone) extraction should keep dependencies.
description: >
If set, the buildless (standalone) extractor will store dependencies in this directory.
type: string

View File

@@ -0,0 +1,62 @@
using System;
using System.IO;
using Semmle.Util;
using Semmle.Util.Logging;
namespace Semmle.Extraction.CSharp.DependencyFetching
{
/// <summary>
/// A directory used for storing fetched dependencies.
/// When a specific directory is set via the dependency directory extractor option,
/// we store dependencies in that directory for caching purposes.
/// Otherwise, we create a temporary directory that is deleted upon disposal.
/// </summary>
public sealed class DependencyDirectory : IDisposable
{
private readonly string userReportedDirectoryPurpose;
private readonly ILogger logger;
private readonly bool attemptCleanup;
public DirectoryInfo DirInfo { get; }
public DependencyDirectory(string subfolderName, string userReportedDirectoryPurpose, ILogger logger)
{
this.logger = logger;
this.userReportedDirectoryPurpose = userReportedDirectoryPurpose;
string path;
if (EnvironmentVariables.GetBuildlessDependencyDir() is string dir)
{
path = dir;
attemptCleanup = false;
}
else
{
path = FileUtils.GetTemporaryWorkingDirectory(out _);
attemptCleanup = true;
}
DirInfo = new DirectoryInfo(Path.Join(path, subfolderName));
DirInfo.Create();
}
public void Dispose()
{
if (!attemptCleanup)
{
logger.LogInfo($"Keeping {userReportedDirectoryPurpose} directory {DirInfo.FullName} for possible caching purposes.");
return;
}
try
{
DirInfo.Delete(true);
}
catch (Exception exc)
{
logger.LogInfo($"Couldn't delete {userReportedDirectoryPurpose} directory {exc.Message}");
}
}
public override string ToString() => DirInfo.FullName;
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Newtonsoft.Json.Linq;
@@ -140,6 +141,8 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
// The version number should be kept in sync with the version .NET version used for building the application.
public const string LatestDotNetSdkVersion = "9.0.300";
public static ReadOnlyDictionary<string, string> MinimalEnvironment => IDotNetCliInvoker.MinimalEnvironment;
/// <summary>
/// Returns a script for downloading relevant versions of the
/// .NET SDK. The SDK(s) will be installed at <code>installDir</code>
@@ -254,7 +257,6 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
else
{
var dotnetInstallPath = actions.PathCombine(tempWorkingDirectory, ".dotnet", "dotnet-install.sh");
var downloadDotNetInstallSh = BuildScript.DownloadFile(
"https://dot.net/v1/dotnet-install.sh",
dotnetInstallPath,
@@ -269,17 +271,28 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
prelude = downloadDotNetInstallSh & chmod.Script;
postlude = shouldCleanUp ? BuildScript.DeleteFile(dotnetInstallPath) : BuildScript.Success;
getInstall = version => new CommandBuilder(actions).
RunCommand(dotnetInstallPath).
Argument("--channel").
Argument("release").
Argument("--version").
Argument(version).
Argument("--install-dir").
Argument(path).Script;
getInstall = version =>
{
var cb = new CommandBuilder(actions).
RunCommand(dotnetInstallPath).
Argument("--channel").
Argument("release").
Argument("--version").
Argument(version);
// Request ARM64 architecture on Apple Silicon machines
if (actions.IsRunningOnAppleSilicon())
{
cb.Argument("--architecture").
Argument("arm64");
}
return cb.Argument("--install-dir").
Argument(path).Script;
};
}
var dotnetInfo = new CommandBuilder(actions).
var dotnetInfo = new CommandBuilder(actions, environment: MinimalEnvironment).
RunCommand(actions.PathCombine(path, "dotnet")).
Argument("--info").Script;
@@ -311,7 +324,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
private static BuildScript GetInstalledSdksScript(IBuildActions actions)
{
var listSdks = new CommandBuilder(actions, silent: true).
var listSdks = new CommandBuilder(actions, silent: true, environment: MinimalEnvironment).
RunCommand("dotnet").
Argument("--list-sdks");
return listSdks.Script;

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using Semmle.Util;
using Semmle.Util.Logging;
@@ -36,10 +37,12 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
{
startInfo.WorkingDirectory = workingDirectory;
}
// Set the .NET CLI language to English to avoid localized output.
startInfo.EnvironmentVariables["DOTNET_CLI_UI_LANGUAGE"] = "en";
startInfo.EnvironmentVariables["MSBUILDDISABLENODEREUSE"] = "1";
startInfo.EnvironmentVariables["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = "true";
// Set minimal environment variables.
foreach (var kvp in IDotNetCliInvoker.MinimalEnvironment)
{
startInfo.EnvironmentVariables[kvp.Key] = kvp.Value;
}
// Configure the proxy settings, if applicable.
if (this.proxy != null)

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Semmle.Extraction.CSharp.DependencyFetching
{
@@ -9,6 +10,20 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
/// </summary>
string Exec { get; }
/// <summary>
/// A minimal environment for running the .NET CLI.
///
/// DOTNET_CLI_UI_LANGUAGE: The .NET CLI language is set to English to avoid localized output.
/// MSBUILDDISABLENODEREUSE: To ensure clean environment for each build.
/// DOTNET_SKIP_FIRST_TIME_EXPERIENCE: To skip first time experience messages.
/// </summary>
static ReadOnlyDictionary<string, string> MinimalEnvironment { get; } = new(new Dictionary<string, string>
{
{"DOTNET_CLI_UI_LANGUAGE", "en"},
{"MSBUILDDISABLENODEREUSE", "1"},
{"DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "true"}
});
/// <summary>
/// Execute `dotnet <paramref name="args"/>` and return true if the command succeeded, otherwise false.
/// If `silent` is true the output of the command is logged as `debug` otherwise as `info`.

View File

@@ -24,16 +24,16 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
private readonly FileProvider fileProvider;
/// <summary>
/// The computed packages directory.
/// This will be in the Temp location
/// The packages directory.
/// This will be in the user-specified or computed Temp location
/// so as to not trample the source tree.
/// </summary>
private readonly TemporaryDirectory packageDirectory;
private readonly DependencyDirectory packageDirectory;
/// <summary>
/// Create the package manager for a specified source tree.
/// </summary>
public NugetExeWrapper(FileProvider fileProvider, TemporaryDirectory packageDirectory, Semmle.Util.Logging.ILogger logger)
public NugetExeWrapper(FileProvider fileProvider, DependencyDirectory packageDirectory, Semmle.Util.Logging.ILogger logger)
{
this.fileProvider = fileProvider;
this.packageDirectory = packageDirectory;

View File

@@ -24,12 +24,12 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
private readonly IDotNet dotnet;
private readonly DependabotProxy? dependabotProxy;
private readonly IDiagnosticsWriter diagnosticsWriter;
private readonly TemporaryDirectory legacyPackageDirectory;
private readonly TemporaryDirectory missingPackageDirectory;
private readonly DependencyDirectory legacyPackageDirectory;
private readonly DependencyDirectory missingPackageDirectory;
private readonly ILogger logger;
private readonly ICompilationInfoContainer compilationInfoContainer;
public TemporaryDirectory PackageDirectory { get; }
public DependencyDirectory PackageDirectory { get; }
public NugetPackageRestorer(
FileProvider fileProvider,
@@ -48,9 +48,9 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
this.logger = logger;
this.compilationInfoContainer = compilationInfoContainer;
PackageDirectory = new TemporaryDirectory(ComputeTempDirectoryPath("packages"), "package", logger);
legacyPackageDirectory = new TemporaryDirectory(ComputeTempDirectoryPath("legacypackages"), "legacy package", logger);
missingPackageDirectory = new TemporaryDirectory(ComputeTempDirectoryPath("missingpackages"), "missing package", logger);
PackageDirectory = new DependencyDirectory("packages", "package", logger);
legacyPackageDirectory = new DependencyDirectory("legacypackages", "legacy package", logger);
missingPackageDirectory = new DependencyDirectory("missingpackages", "missing package", logger);
}
public string? TryRestore(string package)

View File

@@ -76,5 +76,14 @@ namespace Semmle.Util
{
return Environment.GetEnvironmentVariable("CODEQL_EXTRACTOR_CSHARP_OVERLAY_BASE_METADATA_OUT");
}
/// <summary>
/// If set, returns the directory where buildless dependencies should be stored.
/// This can be used for caching dependencies.
/// </summary>
public static string? GetBuildlessDependencyDir()
{
return Environment.GetEnvironmentVariable("CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR");
}
}
}

View File

@@ -0,0 +1,5 @@
{
"sdk": {
"version": "10.0.100"
}
}

View File

@@ -0,0 +1,5 @@
def test1(codeql, csharp):
codeql.database.create()
def test2(codeql, csharp):
codeql.database.create(build_mode="none")

View File

@@ -0,0 +1 @@
| dependencies/packages/newtonsoft.json/13.0.1/lib/netstandard2.0/Newtonsoft.Json.dll:0:0:0:0 | Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed |

View File

@@ -0,0 +1,7 @@
import csharp
from Assembly a
where
not a.getCompilation().getOutputAssembly() = a and
a.getName().matches("%Newtonsoft%")
select a

View File

@@ -0,0 +1,6 @@
class Program
{
static void Main(string[] args)
{
}
}

View File

@@ -0,0 +1,5 @@
{
"sdk": {
"version": "9.0.304"
}
}

View File

@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net9.0</TargetFrameworks>
</PropertyGroup>
<Target Name="DeleteBinObjFolders" BeforeTargets="Clean">
<RemoveDir Directories=".\bin" />
<RemoveDir Directories=".\obj" />
</Target>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,14 @@
import os
import shutil
def test(codeql, csharp, cwd):
path = os.path.join(cwd, "dependencies")
os.environ["CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR"] = path
# The Assemblies.ql query shows that the Newtonsoft assembly is found in the
# dependency directory set above.
codeql.database.create(source_root="proj", build_mode="none")
# Check that the packages directory has been created in the dependencies folder.
packages_dir = os.path.join(path, "packages")
assert os.path.isdir(packages_dir), "The packages directory was not created in the specified dependency directory."
shutil.rmtree(path)

View File

@@ -7,196 +7,197 @@
| 6 | /errorreport:prompt |
| 7 | /warn:9 |
| 8 | /define:TRACE;DEBUG;NET;NET9_0;NETCOREAPP;NET5_0_OR_GREATER;NET6_0_OR_GREATER;NET7_0_OR_GREATER;NET8_0_OR_GREATER;NET9_0_OR_GREATER;NETCOREAPP1_0_OR_GREATER;NETCOREAPP1_1_OR_GREATER;NETCOREAPP2_0_OR_GREATER;NETCOREAPP2_1_OR_GREATER;NETCOREAPP2_2_OR_GREATER;NETCOREAPP3_0_OR_GREATER;NETCOREAPP3_1_OR_GREATER |
| 9 | /highentropyva+ |
| 10 | /nullable:enable |
| 11 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.CSharp.dll |
| 12 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.VisualBasic.Core.dll |
| 13 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.VisualBasic.dll |
| 14 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.Win32.Primitives.dll |
| 15 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.Win32.Registry.dll |
| 16 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/mscorlib.dll |
| 17 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/netstandard.dll |
| 18 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.AppContext.dll |
| 19 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Buffers.dll |
| 20 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.Concurrent.dll |
| 21 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.dll |
| 22 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.Immutable.dll |
| 23 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.NonGeneric.dll |
| 24 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.Specialized.dll |
| 25 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.Annotations.dll |
| 26 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.DataAnnotations.dll |
| 27 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.dll |
| 28 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.EventBasedAsync.dll |
| 29 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.Primitives.dll |
| 30 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.TypeConverter.dll |
| 31 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Configuration.dll |
| 32 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Console.dll |
| 33 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Core.dll |
| 34 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Data.Common.dll |
| 35 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Data.DataSetExtensions.dll |
| 36 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Data.dll |
| 37 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Contracts.dll |
| 38 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Debug.dll |
| 39 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.DiagnosticSource.dll |
| 40 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.FileVersionInfo.dll |
| 41 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Process.dll |
| 42 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.StackTrace.dll |
| 43 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.TextWriterTraceListener.dll |
| 44 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Tools.dll |
| 45 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.TraceSource.dll |
| 46 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Tracing.dll |
| 47 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.dll |
| 48 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Drawing.dll |
| 49 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Drawing.Primitives.dll |
| 50 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Dynamic.Runtime.dll |
| 51 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Formats.Asn1.dll |
| 52 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Formats.Tar.dll |
| 53 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Globalization.Calendars.dll |
| 54 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Globalization.dll |
| 55 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Globalization.Extensions.dll |
| 56 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Compression.Brotli.dll |
| 57 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Compression.dll |
| 58 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Compression.FileSystem.dll |
| 59 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Compression.ZipFile.dll |
| 60 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.dll |
| 61 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.AccessControl.dll |
| 62 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.dll |
| 63 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.DriveInfo.dll |
| 64 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.Primitives.dll |
| 65 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.Watcher.dll |
| 66 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.IsolatedStorage.dll |
| 67 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.MemoryMappedFiles.dll |
| 68 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Pipelines.dll |
| 69 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Pipes.AccessControl.dll |
| 70 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Pipes.dll |
| 71 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.UnmanagedMemoryStream.dll |
| 72 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Linq.dll |
| 73 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Linq.Expressions.dll |
| 74 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Linq.Parallel.dll |
| 75 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Linq.Queryable.dll |
| 76 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Memory.dll |
| 77 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.dll |
| 78 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Http.dll |
| 79 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Http.Json.dll |
| 80 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.HttpListener.dll |
| 81 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Mail.dll |
| 82 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.NameResolution.dll |
| 83 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.NetworkInformation.dll |
| 84 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Ping.dll |
| 85 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Primitives.dll |
| 86 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Quic.dll |
| 87 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Requests.dll |
| 88 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Security.dll |
| 89 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.ServicePoint.dll |
| 90 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Sockets.dll |
| 91 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebClient.dll |
| 92 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebHeaderCollection.dll |
| 93 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebProxy.dll |
| 94 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebSockets.Client.dll |
| 95 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebSockets.dll |
| 96 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Numerics.dll |
| 97 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Numerics.Vectors.dll |
| 98 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ObjectModel.dll |
| 99 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.DispatchProxy.dll |
| 100 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.dll |
| 101 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Emit.dll |
| 102 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Emit.ILGeneration.dll |
| 103 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Emit.Lightweight.dll |
| 104 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Extensions.dll |
| 105 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Metadata.dll |
| 106 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Primitives.dll |
| 107 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.TypeExtensions.dll |
| 108 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Resources.Reader.dll |
| 109 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Resources.ResourceManager.dll |
| 110 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Resources.Writer.dll |
| 111 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.CompilerServices.Unsafe.dll |
| 112 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.CompilerServices.VisualC.dll |
| 113 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.dll |
| 114 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Extensions.dll |
| 115 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Handles.dll |
| 116 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.InteropServices.dll |
| 117 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.InteropServices.JavaScript.dll |
| 118 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.InteropServices.RuntimeInformation.dll |
| 119 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Intrinsics.dll |
| 120 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Loader.dll |
| 121 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Numerics.dll |
| 122 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.dll |
| 123 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.Formatters.dll |
| 124 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.Json.dll |
| 125 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.Primitives.dll |
| 126 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.Xml.dll |
| 127 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.AccessControl.dll |
| 128 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Claims.dll |
| 129 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Algorithms.dll |
| 130 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Cng.dll |
| 131 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Csp.dll |
| 132 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.dll |
| 133 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Encoding.dll |
| 134 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.OpenSsl.dll |
| 135 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Primitives.dll |
| 136 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.X509Certificates.dll |
| 137 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.dll |
| 138 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Principal.dll |
| 139 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Principal.Windows.dll |
| 140 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.SecureString.dll |
| 141 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ServiceModel.Web.dll |
| 142 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ServiceProcess.dll |
| 143 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Encoding.CodePages.dll |
| 144 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Encoding.dll |
| 145 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Encoding.Extensions.dll |
| 146 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Encodings.Web.dll |
| 147 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Json.dll |
| 148 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.RegularExpressions.dll |
| 149 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Channels.dll |
| 150 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.dll |
| 151 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Overlapped.dll |
| 152 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Tasks.Dataflow.dll |
| 153 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Tasks.dll |
| 154 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Tasks.Extensions.dll |
| 155 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Tasks.Parallel.dll |
| 156 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Thread.dll |
| 157 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.ThreadPool.dll |
| 158 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Timer.dll |
| 159 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Transactions.dll |
| 160 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Transactions.Local.dll |
| 161 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ValueTuple.dll |
| 162 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Web.dll |
| 163 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Web.HttpUtility.dll |
| 164 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Windows.dll |
| 165 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.dll |
| 166 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.Linq.dll |
| 167 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.ReaderWriter.dll |
| 168 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.Serialization.dll |
| 169 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XDocument.dll |
| 170 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XmlDocument.dll |
| 171 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XmlSerializer.dll |
| 172 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XPath.dll |
| 173 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XPath.XDocument.dll |
| 174 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/WindowsBase.dll |
| 175 | /debug+ |
| 176 | /debug:portable |
| 177 | /filealign:512 |
| 178 | /generatedfilesout:obj/Debug/net9.0//generated |
| 179 | /optimize- |
| 180 | /out:obj/Debug/net9.0/test.dll |
| 181 | /refout:obj/Debug/net9.0/refint/test.dll |
| 182 | /target:exe |
| 183 | /warnaserror- |
| 184 | /utf8output |
| 185 | /deterministic+ |
| 186 | /langversion:13.0 |
| 187 | /analyzerconfig:obj/Debug/net9.0/test.GeneratedMSBuildEditorConfig.editorconfig |
| 188 | /analyzerconfig:/usr/share/dotnet/sdk/9.0.304/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig |
| 189 | /analyzer:/usr/share/dotnet/sdk/9.0.304/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll |
| 190 | /analyzer:/usr/share/dotnet/sdk/9.0.304/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.NetAnalyzers.dll |
| 191 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/Microsoft.Interop.ComInterfaceGenerator.dll |
| 192 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/Microsoft.Interop.JavaScript.JSImportGenerator.dll |
| 193 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/Microsoft.Interop.LibraryImportGenerator.dll |
| 194 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/Microsoft.Interop.SourceGeneration.dll |
| 195 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/System.Text.Json.SourceGeneration.dll |
| 196 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/System.Text.RegularExpressions.Generator.dll |
| 197 | Program.cs |
| 198 | obj/Debug/net9.0/test.GlobalUsings.g.cs |
| 199 | obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs |
| 200 | obj/Debug/net9.0/test.AssemblyInfo.cs |
| 201 | /warnaserror+:NU1605,SYSLIB0011 |
| 9 | /preferreduilang:en |
| 10 | /highentropyva+ |
| 11 | /nullable:enable |
| 12 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.CSharp.dll |
| 13 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.VisualBasic.Core.dll |
| 14 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.VisualBasic.dll |
| 15 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.Win32.Primitives.dll |
| 16 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/Microsoft.Win32.Registry.dll |
| 17 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/mscorlib.dll |
| 18 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/netstandard.dll |
| 19 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.AppContext.dll |
| 20 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Buffers.dll |
| 21 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.Concurrent.dll |
| 22 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.dll |
| 23 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.Immutable.dll |
| 24 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.NonGeneric.dll |
| 25 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Collections.Specialized.dll |
| 26 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.Annotations.dll |
| 27 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.DataAnnotations.dll |
| 28 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.dll |
| 29 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.EventBasedAsync.dll |
| 30 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.Primitives.dll |
| 31 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ComponentModel.TypeConverter.dll |
| 32 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Configuration.dll |
| 33 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Console.dll |
| 34 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Core.dll |
| 35 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Data.Common.dll |
| 36 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Data.DataSetExtensions.dll |
| 37 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Data.dll |
| 38 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Contracts.dll |
| 39 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Debug.dll |
| 40 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.DiagnosticSource.dll |
| 41 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.FileVersionInfo.dll |
| 42 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Process.dll |
| 43 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.StackTrace.dll |
| 44 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.TextWriterTraceListener.dll |
| 45 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Tools.dll |
| 46 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.TraceSource.dll |
| 47 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Diagnostics.Tracing.dll |
| 48 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.dll |
| 49 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Drawing.dll |
| 50 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Drawing.Primitives.dll |
| 51 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Dynamic.Runtime.dll |
| 52 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Formats.Asn1.dll |
| 53 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Formats.Tar.dll |
| 54 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Globalization.Calendars.dll |
| 55 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Globalization.dll |
| 56 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Globalization.Extensions.dll |
| 57 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Compression.Brotli.dll |
| 58 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Compression.dll |
| 59 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Compression.FileSystem.dll |
| 60 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Compression.ZipFile.dll |
| 61 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.dll |
| 62 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.AccessControl.dll |
| 63 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.dll |
| 64 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.DriveInfo.dll |
| 65 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.Primitives.dll |
| 66 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.FileSystem.Watcher.dll |
| 67 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.IsolatedStorage.dll |
| 68 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.MemoryMappedFiles.dll |
| 69 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Pipelines.dll |
| 70 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Pipes.AccessControl.dll |
| 71 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.Pipes.dll |
| 72 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.IO.UnmanagedMemoryStream.dll |
| 73 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Linq.dll |
| 74 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Linq.Expressions.dll |
| 75 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Linq.Parallel.dll |
| 76 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Linq.Queryable.dll |
| 77 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Memory.dll |
| 78 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.dll |
| 79 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Http.dll |
| 80 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Http.Json.dll |
| 81 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.HttpListener.dll |
| 82 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Mail.dll |
| 83 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.NameResolution.dll |
| 84 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.NetworkInformation.dll |
| 85 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Ping.dll |
| 86 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Primitives.dll |
| 87 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Quic.dll |
| 88 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Requests.dll |
| 89 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Security.dll |
| 90 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.ServicePoint.dll |
| 91 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.Sockets.dll |
| 92 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebClient.dll |
| 93 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebHeaderCollection.dll |
| 94 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebProxy.dll |
| 95 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebSockets.Client.dll |
| 96 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Net.WebSockets.dll |
| 97 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Numerics.dll |
| 98 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Numerics.Vectors.dll |
| 99 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ObjectModel.dll |
| 100 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.DispatchProxy.dll |
| 101 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.dll |
| 102 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Emit.dll |
| 103 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Emit.ILGeneration.dll |
| 104 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Emit.Lightweight.dll |
| 105 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Extensions.dll |
| 106 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Metadata.dll |
| 107 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.Primitives.dll |
| 108 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Reflection.TypeExtensions.dll |
| 109 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Resources.Reader.dll |
| 110 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Resources.ResourceManager.dll |
| 111 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Resources.Writer.dll |
| 112 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.CompilerServices.Unsafe.dll |
| 113 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.CompilerServices.VisualC.dll |
| 114 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.dll |
| 115 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Extensions.dll |
| 116 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Handles.dll |
| 117 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.InteropServices.dll |
| 118 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.InteropServices.JavaScript.dll |
| 119 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.InteropServices.RuntimeInformation.dll |
| 120 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Intrinsics.dll |
| 121 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Loader.dll |
| 122 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Numerics.dll |
| 123 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.dll |
| 124 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.Formatters.dll |
| 125 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.Json.dll |
| 126 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.Primitives.dll |
| 127 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Runtime.Serialization.Xml.dll |
| 128 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.AccessControl.dll |
| 129 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Claims.dll |
| 130 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Algorithms.dll |
| 131 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Cng.dll |
| 132 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Csp.dll |
| 133 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.dll |
| 134 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Encoding.dll |
| 135 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.OpenSsl.dll |
| 136 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.Primitives.dll |
| 137 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Cryptography.X509Certificates.dll |
| 138 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.dll |
| 139 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Principal.dll |
| 140 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.Principal.Windows.dll |
| 141 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Security.SecureString.dll |
| 142 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ServiceModel.Web.dll |
| 143 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ServiceProcess.dll |
| 144 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Encoding.CodePages.dll |
| 145 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Encoding.dll |
| 146 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Encoding.Extensions.dll |
| 147 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Encodings.Web.dll |
| 148 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.Json.dll |
| 149 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Text.RegularExpressions.dll |
| 150 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Channels.dll |
| 151 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.dll |
| 152 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Overlapped.dll |
| 153 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Tasks.Dataflow.dll |
| 154 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Tasks.dll |
| 155 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Tasks.Extensions.dll |
| 156 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Tasks.Parallel.dll |
| 157 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Thread.dll |
| 158 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.ThreadPool.dll |
| 159 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Threading.Timer.dll |
| 160 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Transactions.dll |
| 161 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Transactions.Local.dll |
| 162 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.ValueTuple.dll |
| 163 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Web.dll |
| 164 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Web.HttpUtility.dll |
| 165 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Windows.dll |
| 166 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.dll |
| 167 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.Linq.dll |
| 168 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.ReaderWriter.dll |
| 169 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.Serialization.dll |
| 170 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XDocument.dll |
| 171 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XmlDocument.dll |
| 172 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XmlSerializer.dll |
| 173 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XPath.dll |
| 174 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/System.Xml.XPath.XDocument.dll |
| 175 | /reference:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/ref/net9.0/WindowsBase.dll |
| 176 | /debug+ |
| 177 | /debug:portable |
| 178 | /filealign:512 |
| 179 | /generatedfilesout:obj/Debug/net9.0//generated |
| 180 | /optimize- |
| 181 | /out:obj/Debug/net9.0/test.dll |
| 182 | /refout:obj/Debug/net9.0/refint/test.dll |
| 183 | /target:exe |
| 184 | /warnaserror- |
| 185 | /utf8output |
| 186 | /deterministic+ |
| 187 | /langversion:13.0 |
| 188 | /analyzerconfig:obj/Debug/net9.0/test.GeneratedMSBuildEditorConfig.editorconfig |
| 189 | /analyzerconfig:/usr/share/dotnet/sdk/9.0.304/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig |
| 190 | /analyzer:/usr/share/dotnet/sdk/9.0.304/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll |
| 191 | /analyzer:/usr/share/dotnet/sdk/9.0.304/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.NetAnalyzers.dll |
| 192 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/Microsoft.Interop.ComInterfaceGenerator.dll |
| 193 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/Microsoft.Interop.JavaScript.JSImportGenerator.dll |
| 194 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/Microsoft.Interop.LibraryImportGenerator.dll |
| 195 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/Microsoft.Interop.SourceGeneration.dll |
| 196 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/System.Text.Json.SourceGeneration.dll |
| 197 | /analyzer:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.8/analyzers/dotnet/cs/System.Text.RegularExpressions.Generator.dll |
| 198 | Program.cs |
| 199 | obj/Debug/net9.0/test.GlobalUsings.g.cs |
| 200 | obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs |
| 201 | obj/Debug/net9.0/test.AssemblyInfo.cs |
| 202 | /warnaserror+:NU1605,SYSLIB0011 |

View File

@@ -1,5 +0,0 @@
{
"sdk": {
"version": "10.0.100-rc.2.25502.107"
}
}

View File

@@ -1,6 +0,0 @@
import os
import runs_on
@runs_on.linux
def test(codeql, csharp):
codeql.database.create()

View File

@@ -1 +0,0 @@
Console.WriteLine($"<arguments>{string.Join(",", args)}</arguments>");

View File

@@ -1,10 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -1,5 +0,0 @@
{
"sdk": {
"version": "10.0.100-rc.2.25502.107"
}
}

View File

@@ -1,6 +0,0 @@
import os
import runs_on
@runs_on.windows
def test(codeql, csharp):
codeql.database.create()

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Added a new extractor option to specify a custom directory for dependency downloads in buildless mode. Use `-O buildless_dependency_dir=<path>` to configure the target directory.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Improved stability when downloading .NET versions by setting appropriate environment variables for `dotnet` commands. The correct architecture-specific version of .NET is now downloaded on ARM runners.

View File

@@ -86,6 +86,8 @@ pragma[nomagic]
private predicate constantIntegerExpr(Expr e, int val) {
e.(CompileTimeConstantExpr).getIntValue() = val
or
e.(LongLiteral).getValue().toInt() = val
or
exists(SsaExplicitWrite v, Expr src |
e = v.getARead() and
src = v.getValue() and

View File

@@ -193,7 +193,7 @@ VarRead ssaGetAFirstUse(SsaDefinition def) { firstUse(def, result) }
*
* An SSA variable.
*/
class SsaVariable extends Definition {
deprecated class SsaVariable extends Definition {
/** Gets the SSA source variable underlying this SSA variable. */
SsaSourceVariable getSourceVariable() { result = super.getSourceVariable() }
@@ -203,7 +203,7 @@ class SsaVariable extends Definition {
* Gets the `ControlFlowNode` at which this SSA variable is defined.
*/
pragma[nomagic]
ControlFlowNode getCfgNode() {
deprecated ControlFlowNode getCfgNode() {
exists(BasicBlock bb, int i |
this.definesAt(_, bb, i) and
// phi nodes are inserted at position `-1`
@@ -225,7 +225,7 @@ class SsaVariable extends Definition {
*
* Gets an access of this SSA variable.
*/
VarRead getAUse() { result = getAUse(this) }
deprecated VarRead getAUse() { result = getAUse(this) }
/**
* DEPRECATED: Use `ssaGetAFirstUse(SsaDefinition)` instead.
@@ -272,7 +272,7 @@ class SsaVariable extends Definition {
*
* An SSA variable that either explicitly or implicitly updates the variable.
*/
class SsaUpdate extends SsaVariable instanceof WriteDefinition {
deprecated class SsaUpdate extends SsaVariable instanceof WriteDefinition {
SsaUpdate() { not this instanceof SsaImplicitInit }
}
@@ -281,7 +281,7 @@ class SsaUpdate extends SsaVariable instanceof WriteDefinition {
*
* An SSA variable that is defined by a `VariableUpdate`.
*/
class SsaExplicitUpdate extends SsaUpdate {
deprecated class SsaExplicitUpdate extends SsaUpdate {
private VariableUpdate upd;
SsaExplicitUpdate() { ssaExplicitUpdate(this, upd) }
@@ -409,7 +409,7 @@ deprecated class SsaUncertainImplicitUpdate extends SsaImplicitUpdate {
* An SSA variable that is defined by its initial value in the callable. This
* includes initial values of parameters, fields, and closure variables.
*/
class SsaImplicitInit extends SsaVariable instanceof WriteDefinition {
deprecated class SsaImplicitInit extends SsaVariable instanceof WriteDefinition {
SsaImplicitInit() { ssaImplicitInit(this) }
override string toString() { result = "SSA init(" + this.getSourceVariable() + ")" }
@@ -422,7 +422,7 @@ class SsaImplicitInit extends SsaVariable instanceof WriteDefinition {
*
* Holds if the SSA variable is a parameter defined by its initial value in the callable.
*/
predicate isParameterDefinition(Parameter p) {
deprecated predicate isParameterDefinition(Parameter p) {
this.getSourceVariable() = TLocalVar(p.getCallable(), p) and
p.getCallable().getBody().getControlFlowNode() = this.getCfgNode()
}

View File

@@ -244,7 +244,7 @@ final class UncertainWriteDefinition = Impl::UncertainWriteDefinition;
final class PhiNode = Impl::PhiNode;
predicate ssaExplicitUpdate(SsaUpdate def, VariableUpdate upd) {
deprecated predicate ssaExplicitUpdate(SsaUpdate def, VariableUpdate upd) {
exists(SsaSourceVariable v, BasicBlock bb, int i |
def.definesAt(v, bb, i) and
certainVariableUpdate(v, upd.getControlFlowNode(), bb, i) and
@@ -259,7 +259,7 @@ deprecated predicate ssaUncertainImplicitUpdate(SsaImplicitUpdate def) {
)
}
predicate ssaImplicitInit(WriteDefinition def) {
deprecated predicate ssaImplicitInit(WriteDefinition def) {
exists(SsaSourceVariable v, BasicBlock bb, int i |
def.definesAt(v, bb, i) and
hasEntryDef(v, bb) and
@@ -275,7 +275,7 @@ deprecated predicate ssaDefReachesUncertainDef(TrackedSsaDef def, SsaUncertainIm
Impl::uncertainWriteDefinitionInput(redef, def)
}
VarRead getAUse(Definition def) {
deprecated VarRead getAUse(Definition def) {
exists(SsaSourceVariable v, BasicBlock bb, int i |
Impl::ssaDefReachesRead(v, def, bb, i) and
result.getControlFlowNode() = bb.getNode(i) and
@@ -283,7 +283,7 @@ VarRead getAUse(Definition def) {
)
}
predicate ssaDefReachesEndOfBlock(BasicBlock bb, Definition def) {
deprecated predicate ssaDefReachesEndOfBlock(BasicBlock bb, Definition def) {
Impl::ssaDefReachesEndOfBlock(bb, def, _)
}

View File

@@ -2,7 +2,7 @@ import rust
import codeql.rust.internal.PathResolution
import utils.test.PathResolutionInlineExpectationsTest
query predicate resolveDollarCrate(RelevantPath p, Crate c) {
query predicate resolveDollarCrate(PathExt p, Crate c) {
c = resolvePath(p) and
p.isDollarCrate() and
p.fromSource() and

View File

@@ -11,6 +11,7 @@ ql/rust/ql/src/queries/diagnostics/UnresolvedMacroCalls.ql
ql/rust/ql/src/queries/security/CWE-020/RegexInjection.ql
ql/rust/ql/src/queries/security/CWE-022/TaintedPath.ql
ql/rust/ql/src/queries/security/CWE-089/SqlInjection.ql
ql/rust/ql/src/queries/security/CWE-295/DisabledCertificateCheck.ql
ql/rust/ql/src/queries/security/CWE-311/CleartextTransmission.ql
ql/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql
ql/rust/ql/src/queries/security/CWE-312/CleartextStorageDatabase.ql

View File

@@ -12,6 +12,7 @@ ql/rust/ql/src/queries/security/CWE-020/RegexInjection.ql
ql/rust/ql/src/queries/security/CWE-022/TaintedPath.ql
ql/rust/ql/src/queries/security/CWE-089/SqlInjection.ql
ql/rust/ql/src/queries/security/CWE-117/LogInjection.ql
ql/rust/ql/src/queries/security/CWE-295/DisabledCertificateCheck.ql
ql/rust/ql/src/queries/security/CWE-311/CleartextTransmission.ql
ql/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql
ql/rust/ql/src/queries/security/CWE-312/CleartextStorageDatabase.ql

View File

@@ -12,6 +12,7 @@ ql/rust/ql/src/queries/security/CWE-020/RegexInjection.ql
ql/rust/ql/src/queries/security/CWE-022/TaintedPath.ql
ql/rust/ql/src/queries/security/CWE-089/SqlInjection.ql
ql/rust/ql/src/queries/security/CWE-117/LogInjection.ql
ql/rust/ql/src/queries/security/CWE-295/DisabledCertificateCheck.ql
ql/rust/ql/src/queries/security/CWE-311/CleartextTransmission.ql
ql/rust/ql/src/queries/security/CWE-312/CleartextLogging.ql
ql/rust/ql/src/queries/security/CWE-312/CleartextStorageDatabase.ql

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Added more detailed models for `std::fs` and `std::path`.

View File

@@ -1,5 +1,6 @@
private import codeql.util.Boolean
private import codeql.rust.controlflow.ControlFlowGraph
private import codeql.rust.elements.internal.VariableImpl::Impl as VariableImpl
private import rust
newtype TCompletion =
@@ -123,13 +124,7 @@ class BooleanCompletion extends ConditionalCompletion, TBooleanCompletion {
*/
private predicate cannotCauseMatchFailure(Pat pat) {
pat instanceof RangePat or
// Identifier patterns that are in fact path patterns can cause failures. For
// instance `None`. Only if an `@ ...` part is present can we be sure that
// it's an actual identifier pattern. As a heuristic, if the identifier starts
// with a lower case letter, then we assume that it's an identifier. This
// works for code that follows the Rust naming convention for enums and
// constants.
pat = any(IdentPat p | p.hasPat() or p.getName().getText().charAt(0).isLowercase()) or
pat = any(IdentPat p | p.hasPat() or VariableImpl::variableDecl(_, p.getName(), _)) or
pat instanceof WildcardPat or
pat instanceof RestPat or
pat instanceof RefPat or

View File

@@ -82,7 +82,7 @@ module Impl {
}
private predicate callHasTraitQualifier(CallExpr call, Trait qualifier) {
exists(RelevantPath qualifierPath |
exists(PathExt qualifierPath |
callHasQualifier(call, _, qualifierPath) and
qualifier = resolvePath(qualifierPath) and
// When the qualifier is `Self` and resolves to a trait, it's inside a

View File

@@ -5,6 +5,8 @@
*/
private import codeql.rust.elements.internal.generated.Const
private import codeql.rust.elements.internal.AstNodeImpl::Impl as AstNodeImpl
private import codeql.rust.elements.internal.IdentPatImpl::Impl as IdentPatImpl
private import codeql.rust.elements.internal.PathExprImpl::Impl as PathExprImpl
private import codeql.rust.internal.PathResolution
@@ -36,14 +38,30 @@ module Impl {
* }
* ```
*/
class ConstAccess extends PathExprImpl::PathExpr {
private Const c;
ConstAccess() { c = resolvePath(this.getPath()) }
abstract class ConstAccess extends AstNodeImpl::AstNode {
/** Gets the constant being accessed. */
Const getConst() { result = c }
abstract Const getConst();
override string getAPrimaryQlClass() { result = "ConstAccess" }
}
private class PathExprConstAccess extends ConstAccess, PathExprImpl::PathExpr {
private Const c;
PathExprConstAccess() { c = resolvePath(this.getPath()) }
override Const getConst() { result = c }
override string getAPrimaryQlClass() { result = ConstAccess.super.getAPrimaryQlClass() }
}
private class IdentPatConstAccess extends ConstAccess, IdentPatImpl::IdentPat {
private Const c;
IdentPatConstAccess() { c = resolvePath(this) }
override Const getConst() { result = c }
override string getAPrimaryQlClass() { result = ConstAccess.super.getAPrimaryQlClass() }
}
}

View File

@@ -31,6 +31,8 @@ module Impl {
override string toStringImpl() { result = this.getName() }
override string getAPrimaryQlClass() { result = "FormatTemplateVariableAccess" }
/** Gets the name of the variable */
string getName() { result = argument.getName() }

View File

@@ -4,6 +4,7 @@
* INTERNAL: Do not use.
*/
private import rust
private import codeql.rust.elements.internal.generated.PathExpr
/**
@@ -25,5 +26,11 @@ module Impl {
override string toStringImpl() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getPath().toStringImpl() }
override string getAPrimaryQlClass() {
if this instanceof VariableAccess
then result = "VariableAccess"
else result = super.getAPrimaryQlClass()
}
}
}

View File

@@ -1,8 +1,9 @@
private import rust
private import codeql.rust.controlflow.ControlFlowGraph
private import codeql.rust.internal.PathResolution as PathResolution
private import codeql.rust.elements.internal.generated.ParentChild as ParentChild
private import codeql.rust.elements.internal.AstNodeImpl::Impl as AstNodeImpl
private import codeql.rust.elements.internal.PathImpl::Impl as PathImpl
private import codeql.rust.elements.internal.PathExprBaseImpl::Impl as PathExprBaseImpl
private import codeql.rust.elements.internal.FormatTemplateVariableAccessImpl::Impl as FormatTemplateVariableAccessImpl
private import codeql.util.DenseRank
@@ -98,7 +99,7 @@ module Impl {
* pattern.
*/
cached
private predicate variableDecl(AstNode definingNode, Name name, string text) {
predicate variableDecl(AstNode definingNode, Name name, string text) {
Cached::ref() and
exists(SelfParam sp |
name = sp.getName() and
@@ -117,11 +118,7 @@ module Impl {
not exists(getOutermostEnclosingOrPat(pat)) and definingNode = name
) and
text = name.getText() and
// exclude for now anything starting with an uppercase character, which may be a reference to
// an enum constant (e.g. `None`). This excludes static and constant variables (UPPERCASE),
// which we don't appear to recognize yet anyway. This also assumes programmers follow the
// naming guidelines, which they generally do, but they're not enforced.
not text.charAt(0).isUppercase() and
not PathResolution::identPatIsResolvable(pat) and
// exclude parameters from functions without a body as these are trait method declarations
// without implementations
not exists(Function f | not f.hasBody() and f.getAParam().getPat() = pat) and
@@ -666,7 +663,7 @@ module Impl {
}
/** A variable access. */
class VariableAccess extends PathExprBaseImpl::PathExprBase {
class VariableAccess extends PathExprBase {
private string name;
private Variable v;
@@ -677,10 +674,6 @@ module Impl {
/** Holds if this access is a capture. */
predicate isCapture() { this.getEnclosingCfgScope() != v.getEnclosingCfgScope() }
override string toStringImpl() { result = name }
override string getAPrimaryQlClass() { result = "VariableAccess" }
}
/** Holds if `e` occurs in the LHS of an assignment or compound assignment. */
@@ -722,7 +715,7 @@ module Impl {
}
/** A nested function access. */
class NestedFunctionAccess extends PathExprBaseImpl::PathExprBase {
class NestedFunctionAccess extends PathExprBase {
private Function f;
NestedFunctionAccess() { nestedFunctionAccess(_, f, this) }

View File

@@ -0,0 +1,9 @@
extensions:
- addsTo:
pack: codeql/rust-all
extensible: sinkModel
data:
- ["<native_tls::TlsConnectorBuilder>::danger_accept_invalid_certs", "Argument[0]", "disable-certificate", "manual"]
- ["<native_tls::TlsConnectorBuilder>::danger_accept_invalid_hostnames", "Argument[0]", "disable-certificate", "manual"]
- ["<async_native_tls::connect::TlsConnector>::danger_accept_invalid_certs", "Argument[0]", "disable-certificate", "manual"]
- ["<async_native_tls::connect::TlsConnector>::danger_accept_invalid_hostnames", "Argument[0]", "disable-certificate", "manual"]

View File

@@ -11,6 +11,10 @@ extensions:
data:
- ["<reqwest::async_impl::client::Client>::request", "Argument[1]", "request-url", "manual"]
- ["<reqwest::blocking::client::Client>::request", "Argument[1]", "request-url", "manual"]
- ["<reqwest::async_impl::client::ClientBuilder>::danger_accept_invalid_certs", "Argument[0]", "disable-certificate", "manual"]
- ["<reqwest::async_impl::client::ClientBuilder>::danger_accept_invalid_hostnames", "Argument[0]", "disable-certificate", "manual"]
- ["<reqwest::blocking::client::ClientBuilder>::danger_accept_invalid_certs", "Argument[0]", "disable-certificate", "manual"]
- ["<reqwest::blocking::client::ClientBuilder>::danger_accept_invalid_hostnames", "Argument[0]", "disable-certificate", "manual"]
- addsTo:
pack: codeql/rust-all
extensible: summaryModel

View File

@@ -60,6 +60,7 @@ extensions:
- ["core::ptr::dangling", "ReturnValue", "pointer-invalidate", "manual"]
- ["core::ptr::dangling_mut", "ReturnValue", "pointer-invalidate", "manual"]
- ["core::ptr::null", "ReturnValue", "pointer-invalidate", "manual"]
- ["core::ptr::null_mut", "ReturnValue", "pointer-invalidate", "manual"]
- ["v8::primitives::null", "ReturnValue", "pointer-invalidate", "manual"]
- addsTo:
pack: codeql/rust-all

View File

@@ -3,14 +3,27 @@ extensions:
pack: codeql/rust-all
extensible: sourceModel
data:
- ["std::fs::exists", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["std::fs::read", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["std::fs::read_dir", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["std::fs::read_to_string", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["std::fs::read_link", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["std::fs::metadata", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["std::fs::symlink_metadata", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["<std::fs::DirEntry>::path", "ReturnValue", "file", "manual"]
- ["<std::fs::DirEntry>::file_name", "ReturnValue", "file", "manual"]
- ["<std::fs::File>::open", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["<std::fs::File>::open_buffered", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["<std::fs::OpenOptions>::open", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["<std::path::Path>::exists", "ReturnValue", "file", "manual"]
- ["<std::path::Path>::try_exists", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["<std::path::Path>::is_file", "ReturnValue", "file", "manual"]
- ["<std::path::Path>::is_dir", "ReturnValue", "file", "manual"]
- ["<std::path::Path>::is_symlink", "ReturnValue", "file", "manual"]
- ["<std::path::Path>::metadata", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["<std::path::Path>::symlink_metadata", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["<std::path::Path>::read_dir", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- ["<std::path::Path>::read_link", "ReturnValue.Field[core::result::Result::Ok(0)]", "file", "manual"]
- addsTo:
pack: codeql/rust-all
extensible: sinkModel
@@ -68,3 +81,12 @@ extensions:
- ["<std::path::Path>::with_extension", "Argument[Self].Reference", "ReturnValue", "taint", "manual"]
- ["<std::path::Path>::with_file_name", "Argument[Self].Reference", "ReturnValue", "taint", "manual"]
- ["<std::path::Path>::with_file_name", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["<std::fs::Metadata>::accessed", "Argument[self].Reference", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"]
- ["<std::fs::Metadata>::created", "Argument[self].Reference", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"]
- ["<std::fs::Metadata>::file_type", "Argument[self].Reference", "ReturnValue", "taint", "manual"]
- ["<std::fs::Metadata>::is_file", "Argument[self].Reference", "ReturnValue", "taint", "manual"]
- ["<std::fs::Metadata>::is_dir", "Argument[self].Reference", "ReturnValue", "taint", "manual"]
- ["<std::fs::Metadata>::is_symlink", "Argument[self].Reference", "ReturnValue", "taint", "manual"]
- ["<std::fs::Metadata>::len", "Argument[self].Reference", "ReturnValue", "taint", "manual"]
- ["<std::fs::Metadata>::modified", "Argument[self].Reference", "ReturnValue.Field[core::result::Result::Ok(0)]", "taint", "manual"]
- ["<std::fs::Metadata>::permissions", "Argument[self].Reference", "ReturnValue", "taint", "manual"]

View File

@@ -115,13 +115,11 @@ module Stages {
predicate backref() {
1 = 1
or
exists(resolvePath(_))
exists(resolvePathIgnoreVariableShadowing(_))
or
exists(any(ItemNode i).getASuccessor(_, _, _))
or
exists(any(ImplOrTraitItemNode i).getASelfPath())
or
any(TypeParamItemNode i).hasTraitBound()
}
}

View File

@@ -37,6 +37,9 @@ private module Cached {
TFormatArgsArgIndex(Expr e) { e = any(FormatArgsArg a).getExpr() } or
TItemNode(ItemNode i)
pragma[nomagic]
private predicate isMacroCallLocation(Location loc) { loc = any(MacroCall m).getLocation() }
/**
* Gets an element, of kind `kind`, that element `use` uses, if any.
*/
@@ -44,7 +47,7 @@ private module Cached {
Definition definitionOf(Use use, string kind) {
result = use.getDefinition() and
kind = use.getUseType() and
not result.getLocation() = any(MacroCall m).getLocation()
not isMacroCallLocation(result.getLocation())
}
}

View File

@@ -1,9 +1,49 @@
/**
* Provides functionality for resolving paths, using the predicate `resolvePath`.
*
* Path resolution needs to happen before variable resolution, because otherwise
* we cannot know whether an identifier pattern binds a new variable or whether it
* refers to a constructor or constant:
*
* ```rust
* let x = ...; // `x` is only a variable if it does not resolve to a constructor/constant
* ```
*
* Even though variable names typically start with a lowercase letter and constructors
* with an uppercase letter, this is not enforced by the Rust language.
*
* Variables may shadow declarations, so variable resolution also needs to affect
* path resolution:
*
* ```rust
* fn foo() {} // (1)
*
* fn bar() {
* let f = foo; // `foo` here refers to (1) via path resolution
* let foo = f(); // (2)
* foo // `foo` here refers to (2) via variable resolution
* }
* ```
*
* So it may seem that path resolution and variable resolution must happen in mutual
* recursion, but we would like to keep the inherently global path resolution logic
* separate from the inherently local variable resolution logic. We achieve this by
*
* - First computing global path resolution, where variable shadowing is ignored,
* exposed as the internal predicate `resolvePathIgnoreVariableShadowing`.
* - `resolvePathIgnoreVariableShadowing` is sufficient to determine whether an
* identifier pattern resolves to a constructor/constant, since if it does, it cannot
* be shadowed by a variable. We expose this as the predicate `identPatIsResolvable`.
* - Variable resolution can then be computed as a local property, using only the
* global information from `identPatIsResolvable`.
* - Finally, path resolution can be computed by restricting
* `resolvePathIgnoreVariableShadowing` to paths that are not resolvable via
* variable resolution.
*/
private import rust
private import codeql.rust.elements.internal.generated.ParentChild
private import codeql.rust.elements.internal.AstNodeImpl::Impl as AstNodeImpl
private import codeql.rust.elements.internal.CallExprImpl::Impl as CallExprImpl
private import codeql.rust.internal.CachedStages
private import codeql.rust.frameworks.stdlib.Builtins as Builtins
@@ -184,7 +224,7 @@ abstract class ItemNode extends Locatable {
pragma[nomagic]
final Attr getAttr(string name) {
result = this.getAnAttr() and
result.getMeta().getPath().(RelevantPath).isUnqualified(name)
result.getMeta().getPath().(PathExt).isUnqualified(name)
}
final predicate hasAttr(string name) { exists(this.getAttr(name)) }
@@ -1159,34 +1199,6 @@ final class TypeParamItemNode extends TypeItemNode instanceof TypeParam {
ItemNode resolveABound() { result = resolvePath(this.getABoundPath()) }
/**
* Holds if this type parameter has a trait bound. Examples:
*
* ```rust
* impl<T> Foo<T> { ... } // has no trait bound
*
* impl<T: Trait> Foo<T> { ... } // has trait bound
*
* impl<T> Foo<T> where T: Trait { ... } // has trait bound
* ```
*/
cached
predicate hasTraitBound() { Stages::PathResolutionStage::ref() and exists(this.getABoundPath()) }
/**
* Holds if this type parameter has no trait bound. Examples:
*
* ```rust
* impl<T> Foo<T> { ... } // has no trait bound
*
* impl<T: Trait> Foo<T> { ... } // has trait bound
*
* impl<T> Foo<T> where T: Trait { ... } // has trait bound
* ```
*/
pragma[nomagic]
predicate hasNoTraitBound() { not this.hasTraitBound() }
override string getName() { result = TypeParam.super.getName().getText() }
override Namespace getNamespace() { result.isType() }
@@ -1525,20 +1537,22 @@ private predicate declares(ItemNode item, Namespace ns, string name) {
)
}
/** A path that does not access a local variable. */
class RelevantPath extends Path {
RelevantPath() { not this = any(VariableAccess va).(PathExpr).getPath() }
/**
* A `Path` or an `IdentPat`.
*
* `IdentPat`s are included in order to resolve unqualified references to
* constructors in patterns.
*/
abstract class PathExt extends AstNode {
abstract string getText();
/** Holds if this is an unqualified path with the textual value `name`. */
pragma[nomagic]
predicate isUnqualified(string name) {
not exists(this.getQualifier()) and
not exists(UseTree tree |
tree.hasPath() and
this = getAUseTreeUseTree(tree).getPath().getQualifier*()
) and
name = this.getText()
}
abstract predicate isUnqualified(string name);
abstract Path getQualifier();
abstract string toStringDebug();
/**
* Holds if this is an unqualified path with the textual value `name` and
@@ -1560,6 +1574,33 @@ class RelevantPath extends Path {
predicate isDollarCrate() { this.isUnqualified("$crate", _) }
}
private class PathExtPath extends PathExt instanceof Path {
override string getText() { result = Path.super.getText() }
override predicate isUnqualified(string name) {
not exists(Path.super.getQualifier()) and
not exists(UseTree tree |
tree.hasPath() and
this = getAUseTreeUseTree(tree).getPath().getQualifier*()
) and
name = Path.super.getText()
}
override Path getQualifier() { result = Path.super.getQualifier() }
override string toStringDebug() { result = Path.super.toStringDebug() }
}
private class PathExtIdentPat extends PathExt, IdentPat {
override string getText() { result = this.getName().getText() }
override predicate isUnqualified(string name) { name = this.getText() }
override Path getQualifier() { none() }
override string toStringDebug() { result = this.getText() }
}
private predicate isModule(ItemNode m) { m instanceof Module }
/** Holds if source file `source` contains the module `m`. */
@@ -1583,7 +1624,7 @@ private ItemNode getOuterScope(ItemNode i) {
pragma[nomagic]
private predicate unqualifiedPathLookup(ItemNode ancestor, string name, Namespace ns, ItemNode encl) {
// lookup in the immediately enclosing item
exists(RelevantPath path |
exists(PathExt path |
path.isUnqualified(name, encl) and
ancestor = encl and
not name = ["crate", "$crate", "super", "self"]
@@ -1619,7 +1660,7 @@ private ItemNode getASuccessor(
private predicate isSourceFile(ItemNode source) { source instanceof SourceFileItemNode }
private predicate hasCratePath(ItemNode i) { any(RelevantPath path).isCratePath(_, i) }
private predicate hasCratePath(ItemNode i) { any(PathExt path).isCratePath(_, i) }
private predicate hasChild(ItemNode parent, ItemNode child) { child.getImmediateParent() = parent }
@@ -1631,7 +1672,7 @@ private predicate sourceFileHasCratePathTc(ItemNode i1, ItemNode i2) =
* `name` may be looked up inside `ancestor`.
*/
pragma[nomagic]
private predicate keywordLookup(ItemNode ancestor, string name, RelevantPath p) {
private predicate keywordLookup(ItemNode ancestor, string name, PathExt p) {
// For `crate`, jump directly to the root module
exists(ItemNode i | p.isCratePath(name, i) |
ancestor instanceof SourceFile and
@@ -1645,7 +1686,7 @@ private predicate keywordLookup(ItemNode ancestor, string name, RelevantPath p)
}
pragma[nomagic]
private ItemNode unqualifiedPathLookup(RelevantPath p, Namespace ns, SuccessorKind kind) {
private ItemNode unqualifiedPathLookup(PathExt p, Namespace ns, SuccessorKind kind) {
exists(ItemNode ancestor, string name |
result = getASuccessor(ancestor, pragma[only_bind_into](name), ns, kind, _) and
kind.isInternalOrBoth()
@@ -1660,7 +1701,7 @@ private ItemNode unqualifiedPathLookup(RelevantPath p, Namespace ns, SuccessorKi
}
pragma[nomagic]
private predicate isUnqualifiedSelfPath(RelevantPath path) { path.isUnqualified("Self") }
private predicate isUnqualifiedSelfPath(PathExt path) { path.isUnqualified("Self") }
/** Provides the input to `TraitIsVisible`. */
signature predicate relevantTraitVisibleSig(Element element, Trait trait);
@@ -1743,14 +1784,14 @@ private module DollarCrateResolution {
isDollarCrateSupportedMacroExpansion(_, expansion)
}
private predicate isDollarCratePath(RelevantPath p) { p.isDollarCrate() }
private predicate isDollarCratePath(PathExt p) { p.isDollarCrate() }
private predicate isInDollarCrateMacroExpansion(RelevantPath p, AstNode expansion) =
private predicate isInDollarCrateMacroExpansion(PathExt p, AstNode expansion) =
doublyBoundedFastTC(hasParent/2, isDollarCratePath/1, isDollarCrateSupportedMacroExpansion/1)(p,
expansion)
pragma[nomagic]
private predicate isInDollarCrateMacroExpansionFromFile(File macroDefFile, RelevantPath p) {
private predicate isInDollarCrateMacroExpansionFromFile(File macroDefFile, PathExt p) {
exists(Path macroDefPath, AstNode expansion |
isDollarCrateSupportedMacroExpansion(macroDefPath, expansion) and
isInDollarCrateMacroExpansion(p, expansion) and
@@ -1765,17 +1806,17 @@ private module DollarCrateResolution {
* calls.
*/
pragma[nomagic]
predicate resolveDollarCrate(RelevantPath p, CrateItemNode crate) {
predicate resolveDollarCrate(PathExt p, CrateItemNode crate) {
isInDollarCrateMacroExpansionFromFile(crate.getASourceFile().getFile(), p)
}
}
pragma[nomagic]
private ItemNode resolvePathCand0(RelevantPath path, Namespace ns) {
private ItemNode resolvePathCand0(PathExt path, Namespace ns) {
exists(ItemNode res |
res = unqualifiedPathLookup(path, ns, _) and
if
not any(RelevantPath parent).getQualifier() = path and
not any(PathExt parent).getQualifier() = path and
isUnqualifiedSelfPath(path) and
res instanceof ImplItemNode
then result = res.(ImplItemNodeImpl).resolveSelfTyCand()
@@ -1790,13 +1831,16 @@ private ItemNode resolvePathCand0(RelevantPath path, Namespace ns) {
result = resolveUseTreeListItem(_, _, path, _) and
ns = result.getNamespace()
or
result = resolveBuiltin(path.getSegment().getTypeRepr()) and
not path.getSegment().hasTraitTypeRepr() and
ns.isType()
exists(PathSegment seg |
seg = path.(Path).getSegment() and
result = resolveBuiltin(seg.getTypeRepr()) and
not seg.hasTraitTypeRepr() and
ns.isType()
)
}
pragma[nomagic]
private ItemNode resolvePathCandQualifier(RelevantPath qualifier, RelevantPath path, string name) {
private ItemNode resolvePathCandQualifier(PathExt qualifier, PathExt path, string name) {
qualifier = path.getQualifier() and
result = resolvePathCand(qualifier) and
name = path.getText()
@@ -1844,9 +1888,7 @@ private predicate checkQualifiedVisibility(
* qualifier of `path` and `qualifier` resolves to `q`, if any.
*/
pragma[nomagic]
private ItemNode resolvePathCandQualified(
RelevantPath qualifier, ItemNode q, RelevantPath path, Namespace ns
) {
private ItemNode resolvePathCandQualified(PathExt qualifier, ItemNode q, PathExt path, Namespace ns) {
exists(string name, SuccessorKind kind, UseOption useOpt |
q = resolvePathCandQualifier(qualifier, path, name) and
result = getASuccessor(q, name, ns, kind, useOpt) and
@@ -1855,12 +1897,14 @@ private ItemNode resolvePathCandQualified(
}
/** Holds if path `p` must be looked up in namespace `n`. */
private predicate pathUsesNamespace(Path p, Namespace n) {
private predicate pathUsesNamespace(PathExt p, Namespace n) {
n.isValue() and
(
p = any(PathExpr pe).getPath()
or
p = any(TupleStructPat tsp).getPath()
or
p instanceof PathExtIdentPat
)
or
n.isType() and
@@ -1936,7 +1980,7 @@ private predicate macroUseEdge(
* result in non-monotonic recursion.
*/
pragma[nomagic]
private ItemNode resolvePathCand(RelevantPath path) {
private ItemNode resolvePathCand(PathExt path) {
exists(Namespace ns |
result = resolvePathCand0(path, ns) and
if path = any(ImplItemNode i).getSelfPath()
@@ -1949,7 +1993,13 @@ private ItemNode resolvePathCand(RelevantPath path) {
else
if path = any(PathTypeRepr p).getPath()
then result instanceof TypeItemNode
else any()
else
if path instanceof IdentPat
then
result instanceof VariantItemNode or
result instanceof StructItemNode or
result instanceof ConstItemNode
else any()
|
pathUsesNamespace(path, ns)
or
@@ -1966,7 +2016,7 @@ private ItemNode resolvePathCand(RelevantPath path) {
}
/** Get a trait that should be visible when `path` resolves to `node`, if any. */
private Trait getResolvePathTraitUsed(RelevantPath path, AssocItemNode node) {
private Trait getResolvePathTraitUsed(PathExt path, AssocItemNode node) {
exists(TypeItemNode type, ImplItemNodeImpl impl |
node = resolvePathCandQualified(_, type, path, _) and
typeImplEdge(type, impl, _, _, node, _) and
@@ -1978,9 +2028,9 @@ private predicate pathTraitUsed(Element path, Trait trait) {
trait = getResolvePathTraitUsed(path, _)
}
/** Gets the item that `path` resolves to, if any. */
/** INTERNAL: Do not use; use `resolvePath` instead. */
cached
ItemNode resolvePath(RelevantPath path) {
ItemNode resolvePathIgnoreVariableShadowing(PathExt path) {
result = resolvePathCand(path) and
not path = any(Path parent | exists(resolvePathCand(parent))).getQualifier() and
(
@@ -1993,29 +2043,43 @@ ItemNode resolvePath(RelevantPath path) {
or
// if `path` is the qualifier of a resolvable `parent`, then we should
// resolve `path` to something consistent with what `parent` resolves to
exists(RelevantPath parent |
resolvePathCandQualified(path, result, parent, _) = resolvePath(parent)
exists(PathExt parent |
resolvePathCandQualified(path, result, parent, _) = resolvePathIgnoreVariableShadowing(parent)
)
}
private predicate isUseTreeSubPath(UseTree tree, RelevantPath path) {
/**
* Holds if `ip` resolves to some constructor or constant.
*/
// use `forceLocal` once we implement overlay support
pragma[nomagic]
predicate identPatIsResolvable(IdentPat ip) { exists(resolvePathIgnoreVariableShadowing(ip)) }
/** Gets the item that `path` resolves to, if any. */
pragma[nomagic]
ItemNode resolvePath(PathExt path) {
result = resolvePathIgnoreVariableShadowing(path) and
not path = any(VariableAccess va).(PathExpr).getPath()
}
private predicate isUseTreeSubPath(UseTree tree, PathExt path) {
path = tree.getPath()
or
exists(RelevantPath mid |
exists(PathExt mid |
isUseTreeSubPath(tree, mid) and
path = mid.getQualifier()
)
}
pragma[nomagic]
private predicate isUseTreeSubPathUnqualified(UseTree tree, RelevantPath path, string name) {
private predicate isUseTreeSubPathUnqualified(UseTree tree, PathExt path, string name) {
isUseTreeSubPath(tree, path) and
not exists(path.getQualifier()) and
name = path.getText()
}
pragma[nomagic]
private ItemNode resolveUseTreeListItem(Use use, UseTree tree, RelevantPath path, SuccessorKind kind) {
private ItemNode resolveUseTreeListItem(Use use, UseTree tree, PathExt path, SuccessorKind kind) {
exists(UseOption useOpt | checkQualifiedVisibility(use, result, kind, useOpt) |
exists(UseTree midTree, ItemNode mid, string name |
mid = resolveUseTreeListItem(use, midTree) and
@@ -2032,9 +2096,7 @@ private ItemNode resolveUseTreeListItem(Use use, UseTree tree, RelevantPath path
}
pragma[nomagic]
private ItemNode resolveUseTreeListItemQualifier(
Use use, UseTree tree, RelevantPath path, string name
) {
private ItemNode resolveUseTreeListItemQualifier(Use use, UseTree tree, PathExt path, string name) {
result = resolveUseTreeListItem(use, tree, path.getQualifier(), _) and
name = path.getText()
}
@@ -2189,7 +2251,7 @@ private module Debug {
}
predicate debugUnqualifiedPathLookup(
RelevantPath p, string name, Namespace ns, ItemNode ancestor, string path
PathExt p, string name, Namespace ns, ItemNode ancestor, string path
) {
p = getRelevantLocatable() and
exists(ItemNode encl |
@@ -2199,14 +2261,19 @@ private module Debug {
path = p.toStringDebug()
}
ItemNode debugUnqualifiedPathLookup(PathExt p, Namespace ns, SuccessorKind kind) {
p = getRelevantLocatable() and
result = unqualifiedPathLookup(p, ns, kind)
}
predicate debugItemNode(ItemNode item) { item = getRelevantLocatable() }
ItemNode debugResolvePath(RelevantPath path) {
ItemNode debugResolvePath(PathExt path) {
path = getRelevantLocatable() and
result = resolvePath(path)
}
ItemNode debugResolveUseTreeListItem(Use use, UseTree tree, RelevantPath path, SuccessorKind kind) {
ItemNode debugResolveUseTreeListItem(Use use, UseTree tree, PathExt path, SuccessorKind kind) {
use = getRelevantLocatable() and
result = resolveUseTreeListItem(use, tree, path, kind)
}

View File

@@ -352,7 +352,7 @@ module ArgsAreInstantiationsOf<ArgsAreInstantiationsOfInputSig Input> {
|
rnk = 0
or
argsAreInstantiationsOfFromIndex(call, abs, f, rnk - 1)
argsAreInstantiationsOfToIndex(call, abs, f, rnk - 1)
)
}
@@ -361,15 +361,15 @@ module ArgsAreInstantiationsOf<ArgsAreInstantiationsOfInputSig Input> {
}
}
private module ArgIsInstantiationOfFromIndex =
private module ArgIsInstantiationOfToIndex =
ArgIsInstantiationOf<CallAndPos, ArgIsInstantiationOfInput>;
pragma[nomagic]
private predicate argsAreInstantiationsOfFromIndex(
private predicate argsAreInstantiationsOfToIndex(
Input::Call call, ImplOrTraitItemNode i, Function f, int rnk
) {
exists(FunctionPosition pos |
ArgIsInstantiationOfFromIndex::argIsInstantiationOf(MkCallAndPos(call, pos), i, _) and
ArgIsInstantiationOfToIndex::argIsInstantiationOf(MkCallAndPos(call, pos), i, _) and
call.hasTargetCand(i, f) and
toCheckRanked(i, f, pos, rnk)
)
@@ -382,7 +382,7 @@ module ArgsAreInstantiationsOf<ArgsAreInstantiationsOfInputSig Input> {
pragma[nomagic]
predicate argsAreInstantiationsOf(Input::Call call, ImplOrTraitItemNode i, Function f) {
exists(int rnk |
argsAreInstantiationsOfFromIndex(call, i, f, rnk) and
argsAreInstantiationsOfToIndex(call, i, f, rnk) and
rnk = max(int r | toCheckRanked(i, f, _, r))
)
}

View File

@@ -9,6 +9,7 @@ private import codeql.rust.dataflow.FlowSource
private import codeql.rust.dataflow.FlowSink
private import codeql.rust.Concepts
private import codeql.rust.dataflow.internal.Node
private import codeql.rust.security.Barriers as Barriers
/**
* Provides default sources, sinks and barriers for detecting accesses to
@@ -59,4 +60,10 @@ module AccessInvalidPointer {
private class ModelsAsDataSink extends Sink {
ModelsAsDataSink() { sinkNode(this, "pointer-access") }
}
/**
* A barrier for invalid pointer access vulnerabilities for values checked to
* be non-`null`.
*/
private class NotNullCheckBarrier extends Barrier instanceof Barriers::NotNullCheckBarrier { }
}

View File

@@ -7,6 +7,8 @@ import rust
private import codeql.rust.dataflow.DataFlow
private import codeql.rust.internal.TypeInference as TypeInference
private import codeql.rust.internal.Type
private import codeql.rust.controlflow.ControlFlowGraph as Cfg
private import codeql.rust.controlflow.CfgNodes as CfgNodes
private import codeql.rust.frameworks.stdlib.Builtins as Builtins
/**
@@ -40,3 +42,25 @@ class IntegralOrBooleanTypeBarrier extends DataFlow::Node {
)
}
}
/**
* Holds if guard expression `g` having result `branch` indicates that the
* sub-expression `e` is not null. For example when `ptr.is_null()` is
* `false`, we have that `ptr` is not null.
*/
private predicate notNullCheck(AstNode g, Expr e, boolean branch) {
exists(MethodCallExpr call |
call.getStaticTarget().getName().getText() = "is_null" and
g = call and
e = call.getReceiver() and
branch = false
)
}
/**
* A node representing a value checked to be non-null. This may be an
* appropriate taint flow barrier for some queries.
*/
class NotNullCheckBarrier extends DataFlow::Node {
NotNullCheckBarrier() { this = DataFlow::BarrierGuard<notNullCheck/3>::getABarrierNode() }
}

View File

@@ -0,0 +1,45 @@
/**
* Provides classes and predicates for reasoning about disabled certificate
* check vulnerabilities.
*/
import rust
private import codeql.rust.dataflow.DataFlow
private import codeql.rust.dataflow.FlowSink
private import codeql.rust.Concepts
private import codeql.rust.dataflow.internal.Node as Node
/**
* Provides default sinks for detecting disabled certificate check
* vulnerabilities, as well as extension points for adding your own.
*/
module DisabledCertificateCheckExtensions {
/**
* A data flow sink for disabled certificate check vulnerabilities.
*/
abstract class Sink extends QuerySink::Range {
override string getSinkType() { result = "DisabledCertificateCheck" }
}
/**
* A sink for disabled certificate check vulnerabilities from model data.
*/
private class ModelsAsDataSink extends Sink {
ModelsAsDataSink() { sinkNode(this, "disable-certificate") }
}
/**
* A heuristic sink for disabled certificate check vulnerabilities based on function names.
*/
private class HeuristicSink extends Sink {
HeuristicSink() {
exists(CallExprBase fc |
fc.getStaticTarget().(Function).getName().getText() =
["danger_accept_invalid_certs", "danger_accept_invalid_hostnames"] and
fc.getArg(0) = this.asExpr() and
// don't duplicate modeled sinks
not exists(ModelsAsDataSink s | s.(Node::FlowSummaryNode).getSinkElement().getCall() = fc)
)
}
}
}

View File

@@ -0,0 +1,4 @@
---
category: newQuery
---
* Added a new query `rust/disabled-certificate-check`, to detect disabled TLS certificate checks.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `rust/access-invalid-pointer` query has been improved with new flow sources and barriers.

View File

@@ -0,0 +1,42 @@
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>
The <code>danger_accept_invalid_certs</code> option on TLS connectors and HTTP clients controls whether certificate verification is performed. If this option is set to <code>true</code>, the client will accept any certificate, making it susceptible to man-in-the-middle attacks.
</p>
<p>
Similarly, the <code>danger_accept_invalid_hostnames</code> option controls whether hostname verification is performed. If this option is set to <code>true</code>, the client will accept any valid certificate regardless of the site that certificate is for, again making it susceptible to man-in-the-middle attacks.
</p>
</overview>
<recommendation>
<p>
Do not set <code>danger_accept_invalid_certs</code> or <code>danger_accept_invalid_hostnames</code> to <code>true</code>, except in controlled environments such as tests. In production, always ensure certificate and hostname verification is enabled to prevent security risks.
</p>
</recommendation>
<example>
<p>
The following code snippet shows a function that creates an HTTP client with certificate verification disabled:
</p>
<sample src="DisabledCertificateCheckBad.rs"/>
<p>
In production code, always configure clients to verify certificates:
</p>
<sample src="DisabledCertificateCheckGood.rs"/>
</example>
<references>
<li>
Rust native-tls crate: <a href="https://docs.rs/native-tls/latest/native_tls/struct.TlsConnectorBuilder.html">TlsConnectorBuilder</a>.
</li>
<li>
Rust reqwest crate: <a href="https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html">ClientBuilder</a>.
</li>
<li>
SSL.com: <a href="https://www.ssl.com/article/browsers-and-certificate-validation/">Browsers and Certificate Validation</a>.
</li>
</references>
</qhelp>

View File

@@ -0,0 +1,47 @@
/**
* @name Disabled TLS certificate check
* @description An application that disables TLS certificate checking is more vulnerable to
* man-in-the-middle attacks.
* @kind path-problem
* @problem.severity warning
* @security-severity 7.5
* @precision high
* @id rust/disabled-certificate-check
* @tags security
* external/cwe/cwe-295
*/
import rust
import codeql.rust.dataflow.DataFlow
import codeql.rust.dataflow.TaintTracking
import codeql.rust.security.DisabledCertificateCheckExtensions
import codeql.rust.Concepts
/**
* A taint configuration for disabled TLS certificate checks.
*/
module DisabledCertificateCheckConfig implements DataFlow::ConfigSig {
import DisabledCertificateCheckExtensions
predicate isSource(DataFlow::Node node) {
// the constant `true`
node.asExpr().(BooleanLiteralExpr).getTextValue() = "true"
or
// a value controlled by a potential attacker
node instanceof ActiveThreatModelSource
}
predicate isSink(DataFlow::Node node) { node instanceof Sink }
predicate observeDiffInformedIncrementalMode() { any() }
}
module DisabledCertificateCheckFlow = TaintTracking::Global<DisabledCertificateCheckConfig>;
import DisabledCertificateCheckFlow::PathGraph
from
DisabledCertificateCheckFlow::PathNode sourceNode, DisabledCertificateCheckFlow::PathNode sinkNode
where DisabledCertificateCheckFlow::flowPath(sourceNode, sinkNode)
select sinkNode.getNode(), sourceNode, sinkNode,
"Disabling TLS certificate validation can expose the application to man-in-the-middle attacks."

View File

@@ -0,0 +1,6 @@
// BAD: Disabling certificate validation in Rust
let _client = reqwest::Client::builder()
.danger_accept_invalid_certs(true) // disables certificate validation
.build()
.unwrap();

View File

@@ -0,0 +1,10 @@
// GOOD: Certificate validation is enabled (default)
let _client = reqwest::Client::builder()
.danger_accept_invalid_certs(false) // certificate validation enabled explicitly
.build()
.unwrap();
let _client = native_tls::TlsConnector::builder() // certificate validation enabled by default
.build()
.unwrap();

View File

@@ -22,11 +22,13 @@ import AccessInvalidPointerFlow::PathGraph
* A data flow configuration for accesses to invalid pointers.
*/
module AccessInvalidPointerConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node node) { node instanceof AccessInvalidPointer::Source }
import AccessInvalidPointer
predicate isSink(DataFlow::Node node) { node instanceof AccessInvalidPointer::Sink }
predicate isSource(DataFlow::Node node) { node instanceof Source }
predicate isBarrier(DataFlow::Node barrier) { barrier instanceof AccessInvalidPointer::Barrier }
predicate isSink(DataFlow::Node node) { node instanceof Sink }
predicate isBarrier(DataFlow::Node barrier) { barrier instanceof Barrier }
predicate isBarrierOut(DataFlow::Node node) {
// make sinks barriers so that we only report the closest instance

View File

@@ -22,6 +22,7 @@ private import codeql.rust.security.AccessInvalidPointerExtensions
private import codeql.rust.security.CleartextLoggingExtensions
private import codeql.rust.security.CleartextStorageDatabaseExtensions
private import codeql.rust.security.CleartextTransmissionExtensions
private import codeql.rust.security.DisabledCertificateCheckExtensions
private import codeql.rust.security.HardcodedCryptographicValueExtensions
private import codeql.rust.security.InsecureCookieExtensions
private import codeql.rust.security.LogInjectionExtensions

View File

@@ -660,7 +660,7 @@ macro_expansion.rs:
# 71| getSegment(): [PathSegment] i32
# 71| getIdentifier(): [NameRef] i32
# 72| getTailExpr(): [CastExpr] a as ...
# 72| getExpr(): [PathExpr,VariableAccess] a
# 72| getExpr(): [VariableAccess] a
# 72| getPath(): [Path] a
# 72| getSegment(): [PathSegment] a
# 72| getIdentifier(): [NameRef] a
@@ -738,7 +738,7 @@ macro_expansion.rs:
# 84| getFunctionBody(): [BlockExpr] { ... }
# 84| getStmtList(): [StmtList] StmtList
# 84| getTailExpr(): [MatchExpr] match self { ... }
# 83| getScrutinee(): [PathExpr,VariableAccess] self
# 83| getScrutinee(): [VariableAccess] self
# 83| getPath(): [Path] self
# 83| getSegment(): [PathSegment] self
# 83| getIdentifier(): [NameRef] self
@@ -751,7 +751,7 @@ macro_expansion.rs:
# 85| getArgList(): [ArgList] ArgList
# 83| getArg(0): [StringLiteralExpr] "field"
# 85| getArg(1): [RefExpr] &field
# 85| getExpr(): [PathExpr,VariableAccess] field
# 85| getExpr(): [VariableAccess] field
# 85| getPath(): [Path] field
# 85| getSegment(): [PathSegment] field
# 85| getIdentifier(): [NameRef] field
@@ -760,7 +760,7 @@ macro_expansion.rs:
# 83| getArgList(): [ArgList] ArgList
# 83| getArg(0): [StringLiteralExpr] "MyDerive"
# 83| getIdentifier(): [NameRef] debug_struct
# 83| getReceiver(): [PathExpr,VariableAccess] f
# 83| getReceiver(): [VariableAccess] f
# 83| getPath(): [Path] f
# 83| getSegment(): [PathSegment] f
# 83| getIdentifier(): [NameRef] f
@@ -836,11 +836,11 @@ macro_expansion.rs:
# 89| getStmtList(): [StmtList] StmtList
# 89| getTailExpr(): [MatchExpr] match ... { ... }
# 88| getScrutinee(): [TupleExpr] TupleExpr
# 88| getField(0): [PathExpr,VariableAccess] self
# 88| getField(0): [VariableAccess] self
# 88| getPath(): [Path] self
# 88| getSegment(): [PathSegment] self
# 88| getIdentifier(): [NameRef] self
# 88| getField(1): [PathExpr,VariableAccess] other
# 88| getField(1): [VariableAccess] other
# 88| getPath(): [Path] other
# 88| getSegment(): [PathSegment] other
# 88| getIdentifier(): [NameRef] other
@@ -1076,7 +1076,7 @@ proc_macro.rs:
# 6| getMacroCallExpansion(): [MatchExpr] match ... { ... }
# 6| getScrutinee(): [CallExpr] ...::parse::<...>(...)
# 6| getArgList(): [ArgList] ArgList
# 6| getArg(0): [PathExpr,VariableAccess] attr
# 6| getArg(0): [VariableAccess] attr
# 6| getPath(): [Path] attr
# 6| getSegment(): [PathSegment] attr
# 6| getIdentifier(): [NameRef] attr
@@ -1098,7 +1098,7 @@ proc_macro.rs:
# 6| getIdentifier(): [NameRef] parse
# 6| getMatchArmList(): [MatchArmList] MatchArmList
# 6| getArm(0): [MatchArm] ... => data
# 6| getExpr(): [PathExpr,VariableAccess] data
# 6| getExpr(): [VariableAccess] data
# 6| getPath(): [Path] data
# 6| getSegment(): [PathSegment] data
# 6| getIdentifier(): [NameRef] data
@@ -1124,7 +1124,7 @@ proc_macro.rs:
# 6| getArg(0): [MethodCallExpr] err.to_compile_error()
# 6| getArgList(): [ArgList] ArgList
# 6| getIdentifier(): [NameRef] to_compile_error
# 6| getReceiver(): [PathExpr,VariableAccess] err
# 6| getReceiver(): [VariableAccess] err
# 6| getPath(): [Path] err
# 6| getSegment(): [PathSegment] err
# 6| getIdentifier(): [NameRef] err
@@ -1168,7 +1168,7 @@ proc_macro.rs:
# 7| getMacroCallExpansion(): [MatchExpr] match ... { ... }
# 7| getScrutinee(): [CallExpr] ...::parse::<...>(...)
# 7| getArgList(): [ArgList] ArgList
# 7| getArg(0): [PathExpr,VariableAccess] item
# 7| getArg(0): [VariableAccess] item
# 7| getPath(): [Path] item
# 7| getSegment(): [PathSegment] item
# 7| getIdentifier(): [NameRef] item
@@ -1190,7 +1190,7 @@ proc_macro.rs:
# 7| getIdentifier(): [NameRef] parse
# 7| getMatchArmList(): [MatchArmList] MatchArmList
# 7| getArm(0): [MatchArm] ... => data
# 7| getExpr(): [PathExpr,VariableAccess] data
# 7| getExpr(): [VariableAccess] data
# 7| getPath(): [Path] data
# 7| getSegment(): [PathSegment] data
# 7| getIdentifier(): [NameRef] data
@@ -1216,7 +1216,7 @@ proc_macro.rs:
# 7| getArg(0): [MethodCallExpr] err.to_compile_error()
# 7| getArgList(): [ArgList] ArgList
# 7| getIdentifier(): [NameRef] to_compile_error
# 7| getReceiver(): [PathExpr,VariableAccess] err
# 7| getReceiver(): [VariableAccess] err
# 7| getPath(): [Path] err
# 7| getSegment(): [PathSegment] err
# 7| getIdentifier(): [NameRef] err
@@ -1273,7 +1273,7 @@ proc_macro.rs:
# 10| getInitializer(): [MethodCallExpr] ast.clone()
# 10| getArgList(): [ArgList] ArgList
# 10| getIdentifier(): [NameRef] clone
# 10| getReceiver(): [PathExpr,VariableAccess] ast
# 10| getReceiver(): [VariableAccess] ast
# 10| getPath(): [Path] ast
# 10| getSegment(): [PathSegment] ast
# 10| getIdentifier(): [NameRef] ast
@@ -1283,7 +1283,7 @@ proc_macro.rs:
# 11| getExpr(): [AssignmentExpr] ... = ...
# 11| getLhs(): [FieldExpr] ... .ident
# 11| getContainer(): [FieldExpr] new_ast.sig
# 11| getContainer(): [PathExpr,VariableAccess] new_ast
# 11| getContainer(): [VariableAccess] new_ast
# 11| getPath(): [Path] new_ast
# 11| getSegment(): [PathSegment] new_ast
# 11| getIdentifier(): [NameRef] new_ast
@@ -1320,14 +1320,14 @@ proc_macro.rs:
# 11| getArg(0): [FormatArgsArg] FormatArgsArg
# 11| getExpr(): [FieldExpr] ... .ident
# 11| getContainer(): [FieldExpr] ast.sig
# 11| getContainer(): [PathExpr,VariableAccess] ast
# 11| getContainer(): [VariableAccess] ast
# 11| getPath(): [Path] ast
# 11| getSegment(): [PathSegment] ast
# 11| getIdentifier(): [NameRef] ast
# 11| getIdentifier(): [NameRef] sig
# 11| getIdentifier(): [NameRef] ident
# 11| getArg(1): [FormatArgsArg] FormatArgsArg
# 11| getExpr(): [PathExpr,VariableAccess] i
# 11| getExpr(): [VariableAccess] i
# 11| getPath(): [Path] i
# 11| getSegment(): [PathSegment] i
# 11| getIdentifier(): [NameRef] i
@@ -1359,7 +1359,7 @@ proc_macro.rs:
# 11| getIdentifier(): [NameRef] span
# 11| getReceiver(): [FieldExpr] ... .ident
# 11| getContainer(): [FieldExpr] ast.sig
# 11| getContainer(): [PathExpr,VariableAccess] ast
# 11| getContainer(): [VariableAccess] ast
# 11| getPath(): [Path] ast
# 11| getSegment(): [PathSegment] ast
# 11| getIdentifier(): [NameRef] ast
@@ -1375,14 +1375,14 @@ proc_macro.rs:
# 11| getIdentifier(): [NameRef] Ident
# 11| getSegment(): [PathSegment] new
# 11| getIdentifier(): [NameRef] new
# 12| getTailExpr(): [PathExpr,VariableAccess] new_ast
# 12| getTailExpr(): [VariableAccess] new_ast
# 12| getPath(): [Path] new_ast
# 12| getSegment(): [PathSegment] new_ast
# 12| getIdentifier(): [NameRef] new_ast
# 9| getIdentifier(): [NameRef] map
# 8| getReceiver(): [ParenExpr] (...)
# 8| getExpr(): [RangeExpr] 0..number
# 8| getEnd(): [PathExpr,VariableAccess] number
# 8| getEnd(): [VariableAccess] number
# 8| getPath(): [Path] number
# 8| getSegment(): [PathSegment] number
# 8| getIdentifier(): [NameRef] number
@@ -1614,7 +1614,7 @@ proc_macro.rs:
# 16| getInitializer(): [MethodCallExpr] items.quote_into_iter()
# 15| getArgList(): [ArgList] ArgList
# 15| getIdentifier(): [NameRef] quote_into_iter
# 16| getReceiver(): [PathExpr,VariableAccess] items
# 16| getReceiver(): [VariableAccess] items
# 16| getPath(): [Path] items
# 16| getSegment(): [PathSegment] items
# 16| getIdentifier(): [NameRef] items
@@ -1625,11 +1625,11 @@ proc_macro.rs:
# 15| getName(): [Name] i
# 15| getStatement(1): [LetStmt] let ... = ...
# 15| getInitializer(): [BinaryExpr] ... | ...
# 15| getLhs(): [PathExpr,VariableAccess] has_iter
# 15| getLhs(): [VariableAccess] has_iter
# 15| getPath(): [Path] has_iter
# 15| getSegment(): [PathSegment] has_iter
# 15| getIdentifier(): [NameRef] has_iter
# 15| getRhs(): [PathExpr,VariableAccess] i
# 15| getRhs(): [VariableAccess] i
# 15| getPath(): [Path] i
# 15| getSegment(): [PathSegment] i
# 15| getIdentifier(): [NameRef] i
@@ -1646,7 +1646,7 @@ proc_macro.rs:
# 16| getTokenTree(): [TokenTree] TokenTree
# 15| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr
# 15| getStatement(3): [LetStmt] let _ = has_iter
# 15| getInitializer(): [PathExpr,VariableAccess] has_iter
# 15| getInitializer(): [VariableAccess] has_iter
# 15| getPath(): [Path] has_iter
# 15| getSegment(): [PathSegment] has_iter
# 15| getIdentifier(): [NameRef] has_iter
@@ -1764,7 +1764,7 @@ proc_macro.rs:
# 16| getScrutinee(): [MethodCallExpr] items.next()
# 15| getArgList(): [ArgList] ArgList
# 15| getIdentifier(): [NameRef] next
# 16| getReceiver(): [PathExpr,VariableAccess] items
# 16| getReceiver(): [VariableAccess] items
# 16| getPath(): [Path] items
# 16| getSegment(): [PathSegment] items
# 16| getIdentifier(): [NameRef] items
@@ -1772,7 +1772,7 @@ proc_macro.rs:
# 15| getArm(0): [MatchArm] ... => ...
# 15| getExpr(): [CallExpr] ...::RepInterp(...)
# 15| getArgList(): [ArgList] ArgList
# 15| getArg(0): [PathExpr] _x
# 15| getArg(0): [VariableAccess] _x
# 15| getPath(): [Path] _x
# 15| getSegment(): [PathSegment] _x
# 15| getIdentifier(): [NameRef] _x
@@ -1876,12 +1876,12 @@ proc_macro.rs:
# 16| getExpr(): [CallExpr] ...::to_tokens(...)
# 16| getArgList(): [ArgList] ArgList
# 16| getArg(0): [RefExpr] &items
# 16| getExpr(): [PathExpr,VariableAccess] items
# 16| getExpr(): [VariableAccess] items
# 16| getPath(): [Path] items
# 16| getSegment(): [PathSegment] items
# 16| getIdentifier(): [NameRef] items
# 15| getArg(1): [RefExpr] &mut _s
# 15| getExpr(): [PathExpr] _s
# 15| getExpr(): [VariableAccess] _s
# 15| getPath(): [Path] _s
# 15| getSegment(): [PathSegment] _s
# 15| getIdentifier(): [NameRef] _s
@@ -1993,7 +1993,7 @@ proc_macro.rs:
# 15| getIdentifier(): [NameRef] quote_token_with_context
# 16| getTokenTree(): [TokenTree] TokenTree
# 15| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr
# 15| getTailExpr(): [PathExpr] _s
# 15| getTailExpr(): [VariableAccess] _s
# 15| getPath(): [Path] _s
# 15| getSegment(): [PathSegment] _s
# 15| getIdentifier(): [NameRef] _s
@@ -2040,7 +2040,7 @@ proc_macro.rs:
# 22| getMacroCallExpansion(): [MatchExpr] match ... { ... }
# 22| getScrutinee(): [CallExpr] ...::parse::<...>(...)
# 22| getArgList(): [ArgList] ArgList
# 22| getArg(0): [PathExpr,VariableAccess] item
# 22| getArg(0): [VariableAccess] item
# 22| getPath(): [Path] item
# 22| getSegment(): [PathSegment] item
# 22| getIdentifier(): [NameRef] item
@@ -2062,7 +2062,7 @@ proc_macro.rs:
# 22| getIdentifier(): [NameRef] parse
# 22| getMatchArmList(): [MatchArmList] MatchArmList
# 22| getArm(0): [MatchArm] ... => data
# 22| getExpr(): [PathExpr,VariableAccess] data
# 22| getExpr(): [VariableAccess] data
# 22| getPath(): [Path] data
# 22| getSegment(): [PathSegment] data
# 22| getIdentifier(): [NameRef] data
@@ -2088,7 +2088,7 @@ proc_macro.rs:
# 22| getArg(0): [MethodCallExpr] err.to_compile_error()
# 22| getArgList(): [ArgList] ArgList
# 22| getIdentifier(): [NameRef] to_compile_error
# 22| getReceiver(): [PathExpr,VariableAccess] err
# 22| getReceiver(): [VariableAccess] err
# 22| getPath(): [Path] err
# 22| getSegment(): [PathSegment] err
# 22| getIdentifier(): [NameRef] err
@@ -2123,7 +2123,7 @@ proc_macro.rs:
# 23| getInitializer(): [MethodCallExpr] ast.clone()
# 23| getArgList(): [ArgList] ArgList
# 23| getIdentifier(): [NameRef] clone
# 23| getReceiver(): [PathExpr,VariableAccess] ast
# 23| getReceiver(): [VariableAccess] ast
# 23| getPath(): [Path] ast
# 23| getSegment(): [PathSegment] ast
# 23| getIdentifier(): [NameRef] ast
@@ -2133,7 +2133,7 @@ proc_macro.rs:
# 24| getExpr(): [AssignmentExpr] ... = ...
# 24| getLhs(): [FieldExpr] ... .ident
# 24| getContainer(): [FieldExpr] new_ast.sig
# 24| getContainer(): [PathExpr,VariableAccess] new_ast
# 24| getContainer(): [VariableAccess] new_ast
# 24| getPath(): [Path] new_ast
# 24| getSegment(): [PathSegment] new_ast
# 24| getIdentifier(): [NameRef] new_ast
@@ -2170,7 +2170,7 @@ proc_macro.rs:
# 24| getArg(0): [FormatArgsArg] FormatArgsArg
# 24| getExpr(): [FieldExpr] ... .ident
# 24| getContainer(): [FieldExpr] ast.sig
# 24| getContainer(): [PathExpr,VariableAccess] ast
# 24| getContainer(): [VariableAccess] ast
# 24| getPath(): [Path] ast
# 24| getSegment(): [PathSegment] ast
# 24| getIdentifier(): [NameRef] ast
@@ -2203,7 +2203,7 @@ proc_macro.rs:
# 24| getIdentifier(): [NameRef] span
# 24| getReceiver(): [FieldExpr] ... .ident
# 24| getContainer(): [FieldExpr] ast.sig
# 24| getContainer(): [PathExpr,VariableAccess] ast
# 24| getContainer(): [VariableAccess] ast
# 24| getPath(): [Path] ast
# 24| getSegment(): [PathSegment] ast
# 24| getIdentifier(): [NameRef] ast
@@ -2317,12 +2317,12 @@ proc_macro.rs:
# 26| getExpr(): [CallExpr] ...::to_tokens(...)
# 26| getArgList(): [ArgList] ArgList
# 26| getArg(0): [RefExpr] &ast
# 26| getExpr(): [PathExpr,VariableAccess] ast
# 26| getExpr(): [VariableAccess] ast
# 26| getPath(): [Path] ast
# 26| getSegment(): [PathSegment] ast
# 26| getIdentifier(): [NameRef] ast
# 25| getArg(1): [RefExpr] &mut _s
# 25| getExpr(): [PathExpr] _s
# 25| getExpr(): [VariableAccess] _s
# 25| getPath(): [Path] _s
# 25| getSegment(): [PathSegment] _s
# 25| getIdentifier(): [NameRef] _s
@@ -2362,12 +2362,12 @@ proc_macro.rs:
# 27| getExpr(): [CallExpr] ...::to_tokens(...)
# 27| getArgList(): [ArgList] ArgList
# 27| getArg(0): [RefExpr] &new_ast
# 27| getExpr(): [PathExpr,VariableAccess] new_ast
# 27| getExpr(): [VariableAccess] new_ast
# 27| getPath(): [Path] new_ast
# 27| getSegment(): [PathSegment] new_ast
# 27| getIdentifier(): [NameRef] new_ast
# 25| getArg(1): [RefExpr] &mut _s
# 25| getExpr(): [PathExpr] _s
# 25| getExpr(): [VariableAccess] _s
# 25| getPath(): [Path] _s
# 25| getSegment(): [PathSegment] _s
# 25| getIdentifier(): [NameRef] _s
@@ -2424,7 +2424,7 @@ proc_macro.rs:
# 25| getIdentifier(): [NameRef] quote_token_with_context
# 27| getTokenTree(): [TokenTree] TokenTree
# 25| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr
# 25| getTailExpr(): [PathExpr] _s
# 25| getTailExpr(): [VariableAccess] _s
# 25| getPath(): [Path] _s
# 25| getSegment(): [PathSegment] _s
# 25| getIdentifier(): [NameRef] _s
@@ -2504,7 +2504,7 @@ proc_macro.rs:
# 38| getMacroCallExpansion(): [MatchExpr] match ... { ... }
# 38| getScrutinee(): [CallExpr] ...::parse::<...>(...)
# 38| getArgList(): [ArgList] ArgList
# 38| getArg(0): [PathExpr,VariableAccess] input
# 38| getArg(0): [VariableAccess] input
# 38| getPath(): [Path] input
# 38| getSegment(): [PathSegment] input
# 38| getIdentifier(): [NameRef] input
@@ -2526,7 +2526,7 @@ proc_macro.rs:
# 38| getIdentifier(): [NameRef] parse
# 38| getMatchArmList(): [MatchArmList] MatchArmList
# 38| getArm(0): [MatchArm] ... => data
# 38| getExpr(): [PathExpr,VariableAccess] data
# 38| getExpr(): [VariableAccess] data
# 38| getPath(): [Path] data
# 38| getSegment(): [PathSegment] data
# 38| getIdentifier(): [NameRef] data
@@ -2552,7 +2552,7 @@ proc_macro.rs:
# 38| getArg(0): [MethodCallExpr] err.to_compile_error()
# 38| getArgList(): [ArgList] ArgList
# 38| getIdentifier(): [NameRef] to_compile_error
# 38| getReceiver(): [PathExpr,VariableAccess] err
# 38| getReceiver(): [VariableAccess] err
# 38| getPath(): [Path] err
# 38| getSegment(): [PathSegment] err
# 38| getIdentifier(): [NameRef] err
@@ -2586,7 +2586,7 @@ proc_macro.rs:
# 39| getStatement(1): [LetStmt] let ... = ...
# 39| getInitializer(): [RefExpr] &...
# 39| getExpr(): [FieldExpr] ast.ident
# 39| getContainer(): [PathExpr,VariableAccess] ast
# 39| getContainer(): [VariableAccess] ast
# 39| getPath(): [Path] ast
# 39| getSegment(): [PathSegment] ast
# 39| getIdentifier(): [NameRef] ast
@@ -2623,7 +2623,7 @@ proc_macro.rs:
# 40| getTokenTree(): [TokenTree] TokenTree
# 40| getMacroCallExpansion(): [FormatArgsExpr] FormatArgsExpr
# 40| getArg(0): [FormatArgsArg] FormatArgsArg
# 40| getExpr(): [PathExpr,VariableAccess] name
# 40| getExpr(): [VariableAccess] name
# 40| getPath(): [Path] name
# 40| getSegment(): [PathSegment] name
# 40| getIdentifier(): [NameRef] name
@@ -2652,7 +2652,7 @@ proc_macro.rs:
# 40| getArg(1): [MethodCallExpr] name.span()
# 40| getArgList(): [ArgList] ArgList
# 40| getIdentifier(): [NameRef] span
# 40| getReceiver(): [PathExpr,VariableAccess] name
# 40| getReceiver(): [VariableAccess] name
# 40| getPath(): [Path] name
# 40| getSegment(): [PathSegment] name
# 40| getIdentifier(): [NameRef] name
@@ -2776,7 +2776,7 @@ proc_macro.rs:
# 42| getExpr(): [CallExpr] ...::push_ident(...)
# 42| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -2812,12 +2812,12 @@ proc_macro.rs:
# 42| getExpr(): [CallExpr] ...::to_tokens(...)
# 42| getArgList(): [ArgList] ArgList
# 42| getArg(0): [RefExpr] &const_ident
# 42| getExpr(): [PathExpr,VariableAccess] const_ident
# 42| getExpr(): [VariableAccess] const_ident
# 42| getPath(): [Path] const_ident
# 42| getSegment(): [PathSegment] const_ident
# 42| getIdentifier(): [NameRef] const_ident
# 41| getArg(1): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -2867,7 +2867,7 @@ proc_macro.rs:
# 41| getExpr(): [CallExpr] ...::push_colon(...)
# 41| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -2906,7 +2906,7 @@ proc_macro.rs:
# 42| getExpr(): [CallExpr] ...::push_ident(...)
# 42| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -2952,7 +2952,7 @@ proc_macro.rs:
# 41| getExpr(): [CallExpr] ...::push_eq(...)
# 41| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -2991,7 +2991,7 @@ proc_macro.rs:
# 42| getExpr(): [CallExpr] ...::parse(...)
# 42| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3037,7 +3037,7 @@ proc_macro.rs:
# 41| getExpr(): [CallExpr] ...::push_semi(...)
# 41| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3076,7 +3076,7 @@ proc_macro.rs:
# 44| getExpr(): [CallExpr] ...::push_ident(...)
# 44| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3122,7 +3122,7 @@ proc_macro.rs:
# 44| getExpr(): [CallExpr] ...::push_ident(...)
# 44| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3168,7 +3168,7 @@ proc_macro.rs:
# 44| getExpr(): [CallExpr] ...::push_ident(...)
# 44| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3204,12 +3204,12 @@ proc_macro.rs:
# 44| getExpr(): [CallExpr] ...::to_tokens(...)
# 44| getArgList(): [ArgList] ArgList
# 44| getArg(0): [RefExpr] &name
# 44| getExpr(): [PathExpr,VariableAccess] name
# 44| getExpr(): [VariableAccess] name
# 44| getPath(): [Path] name
# 44| getSegment(): [PathSegment] name
# 44| getIdentifier(): [NameRef] name
# 41| getArg(1): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3259,7 +3259,7 @@ proc_macro.rs:
# 45| getExpr(): [CallExpr] ...::push_group(...)
# 45| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3384,7 +3384,7 @@ proc_macro.rs:
# 45| getExpr(): [CallExpr] ...::push_ident(...)
# 45| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3430,7 +3430,7 @@ proc_macro.rs:
# 45| getExpr(): [CallExpr] ...::push_ident(...)
# 45| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3476,7 +3476,7 @@ proc_macro.rs:
# 41| getExpr(): [CallExpr] ...::push_group(...)
# 41| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3552,7 +3552,7 @@ proc_macro.rs:
# 41| getExpr(): [CallExpr] ...::push_rarrow(...)
# 41| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3591,7 +3591,7 @@ proc_macro.rs:
# 45| getExpr(): [CallExpr] ...::push_ident(...)
# 45| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3637,7 +3637,7 @@ proc_macro.rs:
# 46| getExpr(): [CallExpr] ...::push_group(...)
# 46| getArgList(): [ArgList] ArgList
# 41| getArg(0): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3687,12 +3687,12 @@ proc_macro.rs:
# 46| getExpr(): [CallExpr] ...::to_tokens(...)
# 46| getArgList(): [ArgList] ArgList
# 46| getArg(0): [RefExpr] &const_ident
# 46| getExpr(): [PathExpr,VariableAccess] const_ident
# 46| getExpr(): [VariableAccess] const_ident
# 46| getPath(): [Path] const_ident
# 46| getSegment(): [PathSegment] const_ident
# 46| getIdentifier(): [NameRef] const_ident
# 41| getArg(1): [RefExpr] &mut _s
# 41| getExpr(): [PathExpr] _s
# 41| getExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3706,7 +3706,7 @@ proc_macro.rs:
# 41| getIdentifier(): [NameRef] ToTokens
# 41| getSegment(): [PathSegment] to_tokens
# 41| getIdentifier(): [NameRef] to_tokens
# 41| getTailExpr(): [PathExpr] _s
# 41| getTailExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3752,7 +3752,7 @@ proc_macro.rs:
# 41| getIdentifier(): [NameRef] quote_token_with_context
# 45| getTokenTree(): [TokenTree] TokenTree
# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr
# 41| getTailExpr(): [PathExpr] _s
# 41| getTailExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s
@@ -3798,7 +3798,7 @@ proc_macro.rs:
# 41| getIdentifier(): [NameRef] quote_token_with_context
# 44| getTokenTree(): [TokenTree] TokenTree
# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr
# 41| getTailExpr(): [PathExpr] _s
# 41| getTailExpr(): [VariableAccess] _s
# 41| getPath(): [Path] _s
# 41| getSegment(): [PathSegment] _s
# 41| getIdentifier(): [NameRef] _s

View File

@@ -4,8 +4,10 @@
| test.rs:17:31:17:38 | ...::read | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:22:22:22:39 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:22:22:22:39 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:26:18:26:29 | ...::read_dir | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:29:22:29:25 | path | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:43:27:43:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:51:52:51:59 | read_dir | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:54:22:54:25 | path | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:55:27:55:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). |
| test.rs:65:22:65:34 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). |

View File

@@ -23,7 +23,7 @@ fn test_fs() -> Result<(), Box<dyn std::error::Error>> {
sink(buffer); // $ hasTaintFlow="file.txt"
}
for entry in fs::read_dir("directory")? {
for entry in fs::read_dir("directory")? { // $ Alert[rust/summary/taint-sources]
let e = entry?;
let path = e.path(); // $ Alert[rust/summary/taint-sources]
@@ -48,7 +48,7 @@ fn test_fs() -> Result<(), Box<dyn std::error::Error>> {
sink(file_name.clone().as_encoded_bytes()); // $ MISSING: hasTaintFlow
sink(file_name); // $ hasTaintFlow
}
for entry in std::path::Path::new("directory").read_dir()? {
for entry in std::path::Path::new("directory").read_dir()? { // $ Alert[rust/summary/taint-sources]
let e = entry?;
let path = e.path(); // $ Alert[rust/summary/taint-sources]

View File

@@ -1,6 +1,8 @@
| struct Array | |
| struct Ptr | |
| struct PtrMut | |
| struct Ref | |
| struct RefMut | |
| struct Slice | |
| struct Tuple0 | |
| struct Tuple1 | |

View File

@@ -790,6 +790,49 @@ mod impl_with_attribute_macro {
} // impl_with_attribute_macro::test
}
mod patterns {
#[rustfmt::skip]
pub fn test() -> Option<i32> { // $ item=Option $ item=i32
let x = Some(42); // $ item=Some
let y : Option<i32> = match x { // $ item=Option $ item=i32
Some(y) => { // $ item=Some
None // $ item=None
}
None => // $ item=None
None // $ item=None
};
match y {
N0ne => // local variable
N0ne
}
} // patterns::test
#[rustfmt::skip]
fn test2() -> Option<i32> { // $ item=Option $ item=i32
let test_alias = test; // $ item=patterns::test
let test = test_alias();
test
}
#[rustfmt::skip]
const z: i32 // $ item=i32
= 0; // constz
#[rustfmt::skip]
fn test3() {
let x = Some(0); // $ item=Some
match x {
Some(x) // $ item=Some
=> x,
_ => 0
};
match x {
Some(z) => z, // $ item=Some item=constz
_ => 0
};
}
}
fn main() {
my::nested::nested1::nested2::f(); // $ item=I4
my::f(); // $ item=I38
@@ -826,4 +869,5 @@ fn main() {
AStruct::z_on_type(); // $ item=I124
AStruct {}.z_on_instance(); // $ item=I123 item=I125
impl_with_attribute_macro::test(); // $ item=impl_with_attribute_macro::test
patterns::test(); // $ item=patterns::test
}

View File

@@ -32,6 +32,7 @@ mod
| main.rs:629:1:697:1 | mod m24 |
| main.rs:714:1:766:1 | mod associated_types |
| main.rs:772:1:791:1 | mod impl_with_attribute_macro |
| main.rs:793:1:834:1 | mod patterns |
| my2/mod.rs:1:1:1:16 | mod nested2 |
| my2/mod.rs:20:1:20:12 | mod my3 |
| my2/mod.rs:22:1:23:10 | mod mymod |
@@ -72,7 +73,7 @@ resolvePath
| main.rs:37:17:37:24 | ...::f | main.rs:26:9:28:9 | fn f |
| main.rs:39:17:39:23 | println | {EXTERNAL LOCATION} | MacroRules |
| main.rs:40:17:40:17 | f | main.rs:26:9:28:9 | fn f |
| main.rs:47:9:47:13 | super | main.rs:1:1:829:2 | SourceFile |
| main.rs:47:9:47:13 | super | main.rs:1:1:873:2 | SourceFile |
| main.rs:47:9:47:17 | ...::m1 | main.rs:20:1:44:1 | mod m1 |
| main.rs:47:9:47:21 | ...::m2 | main.rs:25:5:43:5 | mod m2 |
| main.rs:47:9:47:24 | ...::g | main.rs:30:9:34:9 | fn g |
@@ -87,7 +88,7 @@ resolvePath
| main.rs:68:17:68:19 | Foo | main.rs:66:9:66:21 | struct Foo |
| main.rs:71:13:71:15 | Foo | main.rs:60:5:60:17 | struct Foo |
| main.rs:73:5:73:5 | f | main.rs:62:5:69:5 | fn f |
| main.rs:75:5:75:8 | self | main.rs:1:1:829:2 | SourceFile |
| main.rs:75:5:75:8 | self | main.rs:1:1:873:2 | SourceFile |
| main.rs:75:5:75:11 | ...::i | main.rs:78:1:90:1 | fn i |
| main.rs:79:5:79:11 | println | {EXTERNAL LOCATION} | MacroRules |
| main.rs:81:13:81:15 | Foo | main.rs:55:1:55:13 | struct Foo |
@@ -109,7 +110,7 @@ resolvePath
| main.rs:112:9:112:15 | println | {EXTERNAL LOCATION} | MacroRules |
| main.rs:118:9:118:15 | println | {EXTERNAL LOCATION} | MacroRules |
| main.rs:122:9:122:15 | println | {EXTERNAL LOCATION} | MacroRules |
| main.rs:125:13:125:17 | super | main.rs:1:1:829:2 | SourceFile |
| main.rs:125:13:125:17 | super | main.rs:1:1:873:2 | SourceFile |
| main.rs:125:13:125:21 | ...::m5 | main.rs:110:1:114:1 | mod m5 |
| main.rs:126:9:126:9 | f | main.rs:111:5:113:5 | fn f |
| main.rs:126:9:126:9 | f | main.rs:117:5:119:5 | fn f |
@@ -397,77 +398,97 @@ resolvePath
| main.rs:781:21:781:23 | i64 | {EXTERNAL LOCATION} | struct i64 |
| main.rs:783:11:783:13 | i64 | {EXTERNAL LOCATION} | struct i64 |
| main.rs:789:17:789:19 | Foo | main.rs:774:5:774:15 | struct Foo |
| main.rs:794:5:794:6 | my | main.rs:1:1:1:7 | mod my |
| main.rs:794:5:794:14 | ...::nested | my.rs:1:1:1:15 | mod nested |
| main.rs:794:5:794:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 |
| main.rs:794:5:794:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 |
| main.rs:794:5:794:35 | ...::f | my/nested.rs:3:9:5:9 | fn f |
| main.rs:795:5:795:6 | my | main.rs:1:1:1:7 | mod my |
| main.rs:795:5:795:9 | ...::f | my.rs:5:1:7:1 | fn f |
| main.rs:796:5:796:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 |
| main.rs:796:5:796:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 |
| main.rs:796:5:796:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 |
| main.rs:796:5:796:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f |
| main.rs:797:5:797:5 | f | my2/nested2.rs:3:9:5:9 | fn f |
| main.rs:798:5:798:5 | g | my2/nested2.rs:7:9:9:9 | fn g |
| main.rs:799:5:799:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) |
| main.rs:799:5:799:12 | ...::h | main.rs:57:1:76:1 | fn h |
| main.rs:800:5:800:6 | m1 | main.rs:20:1:44:1 | mod m1 |
| main.rs:800:5:800:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 |
| main.rs:800:5:800:13 | ...::g | main.rs:30:9:34:9 | fn g |
| main.rs:801:5:801:6 | m1 | main.rs:20:1:44:1 | mod m1 |
| main.rs:801:5:801:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 |
| main.rs:801:5:801:14 | ...::m3 | main.rs:36:9:42:9 | mod m3 |
| main.rs:801:5:801:17 | ...::h | main.rs:37:27:41:13 | fn h |
| main.rs:802:5:802:6 | m4 | main.rs:46:1:53:1 | mod m4 |
| main.rs:802:5:802:9 | ...::i | main.rs:49:5:52:5 | fn i |
| main.rs:803:5:803:5 | h | main.rs:57:1:76:1 | fn h |
| main.rs:804:5:804:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f |
| main.rs:805:5:805:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g |
| main.rs:806:5:806:5 | j | main.rs:104:1:108:1 | fn j |
| main.rs:807:5:807:6 | m6 | main.rs:116:1:128:1 | mod m6 |
| main.rs:807:5:807:9 | ...::g | main.rs:121:5:127:5 | fn g |
| main.rs:808:5:808:6 | m7 | main.rs:130:1:149:1 | mod m7 |
| main.rs:808:5:808:9 | ...::f | main.rs:141:5:148:5 | fn f |
| main.rs:809:5:809:6 | m8 | main.rs:151:1:205:1 | mod m8 |
| main.rs:809:5:809:9 | ...::g | main.rs:189:5:204:5 | fn g |
| main.rs:810:5:810:6 | m9 | main.rs:207:1:215:1 | mod m9 |
| main.rs:810:5:810:9 | ...::f | main.rs:210:5:214:5 | fn f |
| main.rs:811:5:811:7 | m11 | main.rs:238:1:275:1 | mod m11 |
| main.rs:811:5:811:10 | ...::f | main.rs:243:5:246:5 | fn f |
| main.rs:812:5:812:7 | m15 | main.rs:306:1:375:1 | mod m15 |
| main.rs:812:5:812:10 | ...::f | main.rs:362:5:374:5 | fn f |
| main.rs:813:5:813:7 | m16 | main.rs:377:1:469:1 | mod m16 |
| main.rs:813:5:813:10 | ...::f | main.rs:444:5:468:5 | fn f |
| main.rs:814:5:814:20 | trait_visibility | main.rs:471:1:521:1 | mod trait_visibility |
| main.rs:814:5:814:23 | ...::f | main.rs:498:5:520:5 | fn f |
| main.rs:815:5:815:7 | m17 | main.rs:523:1:553:1 | mod m17 |
| main.rs:815:5:815:10 | ...::f | main.rs:547:5:552:5 | fn f |
| main.rs:816:5:816:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 |
| main.rs:816:5:816:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f |
| main.rs:817:5:817:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 |
| main.rs:817:5:817:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f |
| main.rs:818:5:818:7 | my3 | my2/mod.rs:20:1:20:12 | mod my3 |
| main.rs:818:5:818:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f |
| main.rs:819:5:819:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f |
| main.rs:820:5:820:12 | my_alias | main.rs:1:1:1:7 | mod my |
| main.rs:820:5:820:22 | ...::nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f |
| main.rs:821:5:821:7 | m18 | main.rs:555:1:573:1 | mod m18 |
| main.rs:821:5:821:12 | ...::m19 | main.rs:560:5:572:5 | mod m19 |
| main.rs:821:5:821:17 | ...::m20 | main.rs:565:9:571:9 | mod m20 |
| main.rs:821:5:821:20 | ...::g | main.rs:566:13:570:13 | fn g |
| main.rs:822:5:822:7 | m23 | main.rs:602:1:627:1 | mod m23 |
| main.rs:822:5:822:10 | ...::f | main.rs:622:5:626:5 | fn f |
| main.rs:823:5:823:7 | m24 | main.rs:629:1:697:1 | mod m24 |
| main.rs:823:5:823:10 | ...::f | main.rs:683:5:696:5 | fn f |
| main.rs:824:5:824:8 | zelf | main.rs:0:0:0:0 | Crate(main@0.0.1) |
| main.rs:824:5:824:11 | ...::h | main.rs:57:1:76:1 | fn h |
| main.rs:825:5:825:13 | z_changed | main.rs:702:1:702:9 | fn z_changed |
| main.rs:826:5:826:11 | AStruct | main.rs:704:1:704:17 | struct AStruct |
| main.rs:826:5:826:22 | ...::z_on_type | main.rs:708:5:708:17 | fn z_on_type |
| main.rs:827:5:827:11 | AStruct | main.rs:704:1:704:17 | struct AStruct |
| main.rs:828:5:828:29 | impl_with_attribute_macro | main.rs:772:1:791:1 | mod impl_with_attribute_macro |
| main.rs:828:5:828:35 | ...::test | main.rs:787:5:790:5 | fn test |
| main.rs:795:22:795:32 | Option::<...> | {EXTERNAL LOCATION} | enum Option |
| main.rs:795:29:795:31 | i32 | {EXTERNAL LOCATION} | struct i32 |
| main.rs:796:17:796:20 | Some | {EXTERNAL LOCATION} | Some |
| main.rs:797:17:797:27 | Option::<...> | {EXTERNAL LOCATION} | enum Option |
| main.rs:797:24:797:26 | i32 | {EXTERNAL LOCATION} | struct i32 |
| main.rs:798:13:798:16 | Some | {EXTERNAL LOCATION} | Some |
| main.rs:799:17:799:20 | None | {EXTERNAL LOCATION} | None |
| main.rs:801:13:801:16 | None | {EXTERNAL LOCATION} | None |
| main.rs:802:17:802:20 | None | {EXTERNAL LOCATION} | None |
| main.rs:811:19:811:29 | Option::<...> | {EXTERNAL LOCATION} | enum Option |
| main.rs:811:26:811:28 | i32 | {EXTERNAL LOCATION} | struct i32 |
| main.rs:812:26:812:29 | test | main.rs:794:5:808:5 | fn test |
| main.rs:818:14:818:16 | i32 | {EXTERNAL LOCATION} | struct i32 |
| main.rs:823:17:823:20 | Some | {EXTERNAL LOCATION} | Some |
| main.rs:825:13:825:16 | Some | {EXTERNAL LOCATION} | Some |
| main.rs:830:13:830:16 | Some | {EXTERNAL LOCATION} | Some |
| main.rs:830:18:830:18 | z | main.rs:817:5:819:12 | Const |
| main.rs:830:24:830:24 | z | main.rs:817:5:819:12 | Const |
| main.rs:837:5:837:6 | my | main.rs:1:1:1:7 | mod my |
| main.rs:837:5:837:14 | ...::nested | my.rs:1:1:1:15 | mod nested |
| main.rs:837:5:837:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 |
| main.rs:837:5:837:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 |
| main.rs:837:5:837:35 | ...::f | my/nested.rs:3:9:5:9 | fn f |
| main.rs:838:5:838:6 | my | main.rs:1:1:1:7 | mod my |
| main.rs:838:5:838:9 | ...::f | my.rs:5:1:7:1 | fn f |
| main.rs:839:5:839:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 |
| main.rs:839:5:839:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 |
| main.rs:839:5:839:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 |
| main.rs:839:5:839:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f |
| main.rs:840:5:840:5 | f | my2/nested2.rs:3:9:5:9 | fn f |
| main.rs:841:5:841:5 | g | my2/nested2.rs:7:9:9:9 | fn g |
| main.rs:842:5:842:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) |
| main.rs:842:5:842:12 | ...::h | main.rs:57:1:76:1 | fn h |
| main.rs:843:5:843:6 | m1 | main.rs:20:1:44:1 | mod m1 |
| main.rs:843:5:843:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 |
| main.rs:843:5:843:13 | ...::g | main.rs:30:9:34:9 | fn g |
| main.rs:844:5:844:6 | m1 | main.rs:20:1:44:1 | mod m1 |
| main.rs:844:5:844:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 |
| main.rs:844:5:844:14 | ...::m3 | main.rs:36:9:42:9 | mod m3 |
| main.rs:844:5:844:17 | ...::h | main.rs:37:27:41:13 | fn h |
| main.rs:845:5:845:6 | m4 | main.rs:46:1:53:1 | mod m4 |
| main.rs:845:5:845:9 | ...::i | main.rs:49:5:52:5 | fn i |
| main.rs:846:5:846:5 | h | main.rs:57:1:76:1 | fn h |
| main.rs:847:5:847:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f |
| main.rs:848:5:848:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g |
| main.rs:849:5:849:5 | j | main.rs:104:1:108:1 | fn j |
| main.rs:850:5:850:6 | m6 | main.rs:116:1:128:1 | mod m6 |
| main.rs:850:5:850:9 | ...::g | main.rs:121:5:127:5 | fn g |
| main.rs:851:5:851:6 | m7 | main.rs:130:1:149:1 | mod m7 |
| main.rs:851:5:851:9 | ...::f | main.rs:141:5:148:5 | fn f |
| main.rs:852:5:852:6 | m8 | main.rs:151:1:205:1 | mod m8 |
| main.rs:852:5:852:9 | ...::g | main.rs:189:5:204:5 | fn g |
| main.rs:853:5:853:6 | m9 | main.rs:207:1:215:1 | mod m9 |
| main.rs:853:5:853:9 | ...::f | main.rs:210:5:214:5 | fn f |
| main.rs:854:5:854:7 | m11 | main.rs:238:1:275:1 | mod m11 |
| main.rs:854:5:854:10 | ...::f | main.rs:243:5:246:5 | fn f |
| main.rs:855:5:855:7 | m15 | main.rs:306:1:375:1 | mod m15 |
| main.rs:855:5:855:10 | ...::f | main.rs:362:5:374:5 | fn f |
| main.rs:856:5:856:7 | m16 | main.rs:377:1:469:1 | mod m16 |
| main.rs:856:5:856:10 | ...::f | main.rs:444:5:468:5 | fn f |
| main.rs:857:5:857:20 | trait_visibility | main.rs:471:1:521:1 | mod trait_visibility |
| main.rs:857:5:857:23 | ...::f | main.rs:498:5:520:5 | fn f |
| main.rs:858:5:858:7 | m17 | main.rs:523:1:553:1 | mod m17 |
| main.rs:858:5:858:10 | ...::f | main.rs:547:5:552:5 | fn f |
| main.rs:859:5:859:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 |
| main.rs:859:5:859:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f |
| main.rs:860:5:860:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 |
| main.rs:860:5:860:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f |
| main.rs:861:5:861:7 | my3 | my2/mod.rs:20:1:20:12 | mod my3 |
| main.rs:861:5:861:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f |
| main.rs:862:5:862:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f |
| main.rs:863:5:863:12 | my_alias | main.rs:1:1:1:7 | mod my |
| main.rs:863:5:863:22 | ...::nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f |
| main.rs:864:5:864:7 | m18 | main.rs:555:1:573:1 | mod m18 |
| main.rs:864:5:864:12 | ...::m19 | main.rs:560:5:572:5 | mod m19 |
| main.rs:864:5:864:17 | ...::m20 | main.rs:565:9:571:9 | mod m20 |
| main.rs:864:5:864:20 | ...::g | main.rs:566:13:570:13 | fn g |
| main.rs:865:5:865:7 | m23 | main.rs:602:1:627:1 | mod m23 |
| main.rs:865:5:865:10 | ...::f | main.rs:622:5:626:5 | fn f |
| main.rs:866:5:866:7 | m24 | main.rs:629:1:697:1 | mod m24 |
| main.rs:866:5:866:10 | ...::f | main.rs:683:5:696:5 | fn f |
| main.rs:867:5:867:8 | zelf | main.rs:0:0:0:0 | Crate(main@0.0.1) |
| main.rs:867:5:867:11 | ...::h | main.rs:57:1:76:1 | fn h |
| main.rs:868:5:868:13 | z_changed | main.rs:702:1:702:9 | fn z_changed |
| main.rs:869:5:869:11 | AStruct | main.rs:704:1:704:17 | struct AStruct |
| main.rs:869:5:869:22 | ...::z_on_type | main.rs:708:5:708:17 | fn z_on_type |
| main.rs:870:5:870:11 | AStruct | main.rs:704:1:704:17 | struct AStruct |
| main.rs:871:5:871:29 | impl_with_attribute_macro | main.rs:772:1:791:1 | mod impl_with_attribute_macro |
| main.rs:871:5:871:35 | ...::test | main.rs:787:5:790:5 | fn test |
| main.rs:872:5:872:12 | patterns | main.rs:793:1:834:1 | mod patterns |
| main.rs:872:5:872:18 | ...::test | main.rs:794:5:808:5 | fn test |
| my2/mod.rs:4:5:4:11 | println | {EXTERNAL LOCATION} | MacroRules |
| my2/mod.rs:5:5:5:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 |
| my2/mod.rs:5:5:5:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 |
@@ -493,7 +514,7 @@ resolvePath
| my2/my3/mod.rs:3:5:3:5 | g | my2/mod.rs:3:1:6:1 | fn g |
| my2/my3/mod.rs:4:5:4:5 | h | main.rs:57:1:76:1 | fn h |
| my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:25:34 | SourceFile |
| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:829:2 | SourceFile |
| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:873:2 | SourceFile |
| my2/my3/mod.rs:7:5:7:19 | ...::h | main.rs:57:1:76:1 | fn h |
| my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:25:34 | SourceFile |
| my2/my3/mod.rs:8:5:8:12 | ...::g | my2/mod.rs:3:1:6:1 | fn g |

View File

@@ -5,7 +5,7 @@ import TestUtils
query predicate mod(Module m) { toBeTested(m) }
query predicate resolvePath(Path p, ItemNode i) {
query predicate resolvePath(PathExt p, ItemNode i) {
toBeTested(p) and
not p.isFromMacroExpansion() and
i = resolvePath(p)

View File

@@ -1798,145 +1798,216 @@ edges
| main.rs:753:5:753:16 | print_i64(...) | main.rs:744:18:754:1 | { ... } | |
| main.rs:753:5:753:17 | ExprStmt | main.rs:753:5:753:13 | print_i64 | |
| main.rs:753:15:753:15 | x | main.rs:753:5:753:16 | print_i64(...) | |
| main.rs:756:1:800:1 | enter fn main | main.rs:757:5:757:25 | ExprStmt | |
| main.rs:756:1:800:1 | exit fn main (normal) | main.rs:756:1:800:1 | exit fn main | |
| main.rs:756:11:800:1 | { ... } | main.rs:756:1:800:1 | exit fn main (normal) | |
| main.rs:757:5:757:22 | immutable_variable | main.rs:757:5:757:24 | immutable_variable(...) | |
| main.rs:757:5:757:24 | immutable_variable(...) | main.rs:758:5:758:23 | ExprStmt | |
| main.rs:757:5:757:25 | ExprStmt | main.rs:757:5:757:22 | immutable_variable | |
| main.rs:758:5:758:20 | mutable_variable | main.rs:758:5:758:22 | mutable_variable(...) | |
| main.rs:758:5:758:22 | mutable_variable(...) | main.rs:759:5:759:40 | ExprStmt | |
| main.rs:758:5:758:23 | ExprStmt | main.rs:758:5:758:20 | mutable_variable | |
| main.rs:759:5:759:37 | mutable_variable_immutable_borrow | main.rs:759:5:759:39 | mutable_variable_immutable_borrow(...) | |
| main.rs:759:5:759:39 | mutable_variable_immutable_borrow(...) | main.rs:760:5:760:23 | ExprStmt | |
| main.rs:759:5:759:40 | ExprStmt | main.rs:759:5:759:37 | mutable_variable_immutable_borrow | |
| main.rs:760:5:760:20 | variable_shadow1 | main.rs:760:5:760:22 | variable_shadow1(...) | |
| main.rs:760:5:760:22 | variable_shadow1(...) | main.rs:761:5:761:23 | ExprStmt | |
| main.rs:760:5:760:23 | ExprStmt | main.rs:760:5:760:20 | variable_shadow1 | |
| main.rs:761:5:761:20 | variable_shadow2 | main.rs:761:5:761:22 | variable_shadow2(...) | |
| main.rs:761:5:761:22 | variable_shadow2(...) | main.rs:762:5:762:19 | ExprStmt | |
| main.rs:761:5:761:23 | ExprStmt | main.rs:761:5:761:20 | variable_shadow2 | |
| main.rs:762:5:762:16 | let_pattern1 | main.rs:762:5:762:18 | let_pattern1(...) | |
| main.rs:762:5:762:18 | let_pattern1(...) | main.rs:763:5:763:19 | ExprStmt | |
| main.rs:762:5:762:19 | ExprStmt | main.rs:762:5:762:16 | let_pattern1 | |
| main.rs:763:5:763:16 | let_pattern2 | main.rs:763:5:763:18 | let_pattern2(...) | |
| main.rs:763:5:763:18 | let_pattern2(...) | main.rs:764:5:764:19 | ExprStmt | |
| main.rs:763:5:763:19 | ExprStmt | main.rs:763:5:763:16 | let_pattern2 | |
| main.rs:764:5:764:16 | let_pattern3 | main.rs:764:5:764:18 | let_pattern3(...) | |
| main.rs:764:5:764:18 | let_pattern3(...) | main.rs:765:5:765:19 | ExprStmt | |
| main.rs:764:5:764:19 | ExprStmt | main.rs:764:5:764:16 | let_pattern3 | |
| main.rs:765:5:765:16 | let_pattern4 | main.rs:765:5:765:18 | let_pattern4(...) | |
| main.rs:765:5:765:18 | let_pattern4(...) | main.rs:766:5:766:21 | ExprStmt | |
| main.rs:765:5:765:19 | ExprStmt | main.rs:765:5:765:16 | let_pattern4 | |
| main.rs:766:5:766:18 | match_pattern1 | main.rs:766:5:766:20 | match_pattern1(...) | |
| main.rs:766:5:766:20 | match_pattern1(...) | main.rs:767:5:767:21 | ExprStmt | |
| main.rs:766:5:766:21 | ExprStmt | main.rs:766:5:766:18 | match_pattern1 | |
| main.rs:767:5:767:18 | match_pattern2 | main.rs:767:5:767:20 | match_pattern2(...) | |
| main.rs:767:5:767:20 | match_pattern2(...) | main.rs:768:5:768:21 | ExprStmt | |
| main.rs:767:5:767:21 | ExprStmt | main.rs:767:5:767:18 | match_pattern2 | |
| main.rs:768:5:768:18 | match_pattern3 | main.rs:768:5:768:20 | match_pattern3(...) | |
| main.rs:768:5:768:20 | match_pattern3(...) | main.rs:769:5:769:21 | ExprStmt | |
| main.rs:768:5:768:21 | ExprStmt | main.rs:768:5:768:18 | match_pattern3 | |
| main.rs:769:5:769:18 | match_pattern4 | main.rs:769:5:769:20 | match_pattern4(...) | |
| main.rs:769:5:769:20 | match_pattern4(...) | main.rs:770:5:770:21 | ExprStmt | |
| main.rs:769:5:769:21 | ExprStmt | main.rs:769:5:769:18 | match_pattern4 | |
| main.rs:770:5:770:18 | match_pattern5 | main.rs:770:5:770:20 | match_pattern5(...) | |
| main.rs:770:5:770:20 | match_pattern5(...) | main.rs:771:5:771:21 | ExprStmt | |
| main.rs:770:5:770:21 | ExprStmt | main.rs:770:5:770:18 | match_pattern5 | |
| main.rs:771:5:771:18 | match_pattern6 | main.rs:771:5:771:20 | match_pattern6(...) | |
| main.rs:771:5:771:20 | match_pattern6(...) | main.rs:772:5:772:21 | ExprStmt | |
| main.rs:771:5:771:21 | ExprStmt | main.rs:771:5:771:18 | match_pattern6 | |
| main.rs:772:5:772:18 | match_pattern7 | main.rs:772:5:772:20 | match_pattern7(...) | |
| main.rs:772:5:772:20 | match_pattern7(...) | main.rs:773:5:773:21 | ExprStmt | |
| main.rs:772:5:772:21 | ExprStmt | main.rs:772:5:772:18 | match_pattern7 | |
| main.rs:773:5:773:18 | match_pattern8 | main.rs:773:5:773:20 | match_pattern8(...) | |
| main.rs:773:5:773:20 | match_pattern8(...) | main.rs:774:5:774:21 | ExprStmt | |
| main.rs:773:5:773:21 | ExprStmt | main.rs:773:5:773:18 | match_pattern8 | |
| main.rs:774:5:774:18 | match_pattern9 | main.rs:774:5:774:20 | match_pattern9(...) | |
| main.rs:774:5:774:20 | match_pattern9(...) | main.rs:775:5:775:22 | ExprStmt | |
| main.rs:774:5:774:21 | ExprStmt | main.rs:774:5:774:18 | match_pattern9 | |
| main.rs:775:5:775:19 | match_pattern10 | main.rs:775:5:775:21 | match_pattern10(...) | |
| main.rs:775:5:775:21 | match_pattern10(...) | main.rs:776:5:776:22 | ExprStmt | |
| main.rs:775:5:775:22 | ExprStmt | main.rs:775:5:775:19 | match_pattern10 | |
| main.rs:776:5:776:19 | match_pattern11 | main.rs:776:5:776:21 | match_pattern11(...) | |
| main.rs:776:5:776:21 | match_pattern11(...) | main.rs:777:5:777:22 | ExprStmt | |
| main.rs:776:5:776:22 | ExprStmt | main.rs:776:5:776:19 | match_pattern11 | |
| main.rs:777:5:777:19 | match_pattern12 | main.rs:777:5:777:21 | match_pattern12(...) | |
| main.rs:777:5:777:21 | match_pattern12(...) | main.rs:778:5:778:22 | ExprStmt | |
| main.rs:777:5:777:22 | ExprStmt | main.rs:777:5:777:19 | match_pattern12 | |
| main.rs:778:5:778:19 | match_pattern13 | main.rs:778:5:778:21 | match_pattern13(...) | |
| main.rs:778:5:778:21 | match_pattern13(...) | main.rs:779:5:779:22 | ExprStmt | |
| main.rs:778:5:778:22 | ExprStmt | main.rs:778:5:778:19 | match_pattern13 | |
| main.rs:779:5:779:19 | match_pattern14 | main.rs:779:5:779:21 | match_pattern14(...) | |
| main.rs:779:5:779:21 | match_pattern14(...) | main.rs:780:5:780:22 | ExprStmt | |
| main.rs:779:5:779:22 | ExprStmt | main.rs:779:5:779:19 | match_pattern14 | |
| main.rs:780:5:780:19 | match_pattern15 | main.rs:780:5:780:21 | match_pattern15(...) | |
| main.rs:780:5:780:21 | match_pattern15(...) | main.rs:781:5:781:22 | ExprStmt | |
| main.rs:780:5:780:22 | ExprStmt | main.rs:780:5:780:19 | match_pattern15 | |
| main.rs:781:5:781:19 | match_pattern16 | main.rs:781:5:781:21 | match_pattern16(...) | |
| main.rs:781:5:781:21 | match_pattern16(...) | main.rs:782:5:782:36 | ExprStmt | |
| main.rs:781:5:781:22 | ExprStmt | main.rs:781:5:781:19 | match_pattern16 | |
| main.rs:782:5:782:18 | param_pattern1 | main.rs:782:20:782:22 | "a" | |
| main.rs:782:5:782:35 | param_pattern1(...) | main.rs:783:5:783:37 | ExprStmt | |
| main.rs:782:5:782:36 | ExprStmt | main.rs:782:5:782:18 | param_pattern1 | |
| main.rs:782:20:782:22 | "a" | main.rs:782:26:782:28 | "b" | |
| main.rs:782:25:782:34 | TupleExpr | main.rs:782:5:782:35 | param_pattern1(...) | |
| main.rs:782:26:782:28 | "b" | main.rs:782:31:782:33 | "c" | |
| main.rs:782:31:782:33 | "c" | main.rs:782:25:782:34 | TupleExpr | |
| main.rs:783:5:783:18 | param_pattern2 | main.rs:783:20:783:31 | ...::Left | |
| main.rs:783:5:783:36 | param_pattern2(...) | main.rs:784:5:784:26 | ExprStmt | |
| main.rs:783:5:783:37 | ExprStmt | main.rs:783:5:783:18 | param_pattern2 | |
| main.rs:783:20:783:31 | ...::Left | main.rs:783:33:783:34 | 45 | |
| main.rs:783:20:783:35 | ...::Left(...) | main.rs:783:5:783:36 | param_pattern2(...) | |
| main.rs:783:33:783:34 | 45 | main.rs:783:20:783:35 | ...::Left(...) | |
| main.rs:784:5:784:23 | destruct_assignment | main.rs:784:5:784:25 | destruct_assignment(...) | |
| main.rs:784:5:784:25 | destruct_assignment(...) | main.rs:785:5:785:23 | ExprStmt | |
| main.rs:784:5:784:26 | ExprStmt | main.rs:784:5:784:23 | destruct_assignment | |
| main.rs:785:5:785:20 | closure_variable | main.rs:785:5:785:22 | closure_variable(...) | |
| main.rs:785:5:785:22 | closure_variable(...) | main.rs:786:5:786:22 | ExprStmt | |
| main.rs:785:5:785:23 | ExprStmt | main.rs:785:5:785:20 | closure_variable | |
| main.rs:786:5:786:19 | nested_function | main.rs:786:5:786:21 | nested_function(...) | |
| main.rs:786:5:786:21 | nested_function(...) | main.rs:787:5:787:19 | ExprStmt | |
| main.rs:786:5:786:22 | ExprStmt | main.rs:786:5:786:19 | nested_function | |
| main.rs:787:5:787:16 | for_variable | main.rs:787:5:787:18 | for_variable(...) | |
| main.rs:787:5:787:18 | for_variable(...) | main.rs:788:5:788:17 | ExprStmt | |
| main.rs:787:5:787:19 | ExprStmt | main.rs:787:5:787:16 | for_variable | |
| main.rs:788:5:788:14 | add_assign | main.rs:788:5:788:16 | add_assign(...) | |
| main.rs:788:5:788:16 | add_assign(...) | main.rs:789:5:789:13 | ExprStmt | |
| main.rs:788:5:788:17 | ExprStmt | main.rs:788:5:788:14 | add_assign | |
| main.rs:789:5:789:10 | mutate | main.rs:789:5:789:12 | mutate(...) | |
| main.rs:789:5:789:12 | mutate(...) | main.rs:790:5:790:17 | ExprStmt | |
| main.rs:789:5:789:13 | ExprStmt | main.rs:789:5:789:10 | mutate | |
| main.rs:790:5:790:14 | mutate_arg | main.rs:790:5:790:16 | mutate_arg(...) | |
| main.rs:790:5:790:16 | mutate_arg(...) | main.rs:791:5:791:12 | ExprStmt | |
| main.rs:790:5:790:17 | ExprStmt | main.rs:790:5:790:14 | mutate_arg | |
| main.rs:791:5:791:9 | alias | main.rs:791:5:791:11 | alias(...) | |
| main.rs:791:5:791:11 | alias(...) | main.rs:792:5:792:18 | ExprStmt | |
| main.rs:791:5:791:12 | ExprStmt | main.rs:791:5:791:9 | alias | |
| main.rs:792:5:792:15 | capture_mut | main.rs:792:5:792:17 | capture_mut(...) | |
| main.rs:792:5:792:17 | capture_mut(...) | main.rs:793:5:793:20 | ExprStmt | |
| main.rs:792:5:792:18 | ExprStmt | main.rs:792:5:792:15 | capture_mut | |
| main.rs:793:5:793:17 | capture_immut | main.rs:793:5:793:19 | capture_immut(...) | |
| main.rs:793:5:793:19 | capture_immut(...) | main.rs:794:5:794:26 | ExprStmt | |
| main.rs:793:5:793:20 | ExprStmt | main.rs:793:5:793:17 | capture_immut | |
| main.rs:794:5:794:23 | async_block_capture | main.rs:794:5:794:25 | async_block_capture(...) | |
| main.rs:794:5:794:25 | async_block_capture(...) | main.rs:795:5:795:14 | ExprStmt | |
| main.rs:794:5:794:26 | ExprStmt | main.rs:794:5:794:23 | async_block_capture | |
| main.rs:795:5:795:11 | structs | main.rs:795:5:795:13 | structs(...) | |
| main.rs:795:5:795:13 | structs(...) | main.rs:796:5:796:14 | ExprStmt | |
| main.rs:795:5:795:14 | ExprStmt | main.rs:795:5:795:11 | structs | |
| main.rs:796:5:796:11 | ref_arg | main.rs:796:5:796:13 | ref_arg(...) | |
| main.rs:796:5:796:13 | ref_arg(...) | main.rs:797:5:797:30 | ExprStmt | |
| main.rs:796:5:796:14 | ExprStmt | main.rs:796:5:796:11 | ref_arg | |
| main.rs:797:5:797:27 | ref_methodcall_receiver | main.rs:797:5:797:29 | ref_methodcall_receiver(...) | |
| main.rs:797:5:797:29 | ref_methodcall_receiver(...) | main.rs:798:5:798:23 | ExprStmt | |
| main.rs:797:5:797:30 | ExprStmt | main.rs:797:5:797:27 | ref_methodcall_receiver | |
| main.rs:798:5:798:20 | macro_invocation | main.rs:798:5:798:22 | macro_invocation(...) | |
| main.rs:798:5:798:22 | macro_invocation(...) | main.rs:799:5:799:18 | ExprStmt | |
| main.rs:798:5:798:23 | ExprStmt | main.rs:798:5:798:20 | macro_invocation | |
| main.rs:799:5:799:15 | capture_phi | main.rs:799:5:799:17 | capture_phi(...) | |
| main.rs:799:5:799:17 | capture_phi(...) | main.rs:756:11:800:1 | { ... } | |
| main.rs:799:5:799:18 | ExprStmt | main.rs:799:5:799:15 | capture_phi | |
| main.rs:757:5:772:5 | enter fn test | main.rs:759:9:759:25 | let ... = ... | |
| main.rs:757:5:772:5 | exit fn test (normal) | main.rs:757:5:772:5 | exit fn test | |
| main.rs:758:34:772:5 | { ... } | main.rs:757:5:772:5 | exit fn test (normal) | |
| main.rs:759:9:759:25 | let ... = ... | main.rs:759:17:759:20 | Some | |
| main.rs:759:13:759:13 | x | main.rs:759:13:759:13 | x | |
| main.rs:759:13:759:13 | x | main.rs:760:9:767:10 | let ... = ... | match |
| main.rs:759:17:759:20 | Some | main.rs:759:22:759:23 | 42 | |
| main.rs:759:17:759:24 | Some(...) | main.rs:759:13:759:13 | x | |
| main.rs:759:22:759:23 | 42 | main.rs:759:17:759:24 | Some(...) | |
| main.rs:760:9:767:10 | let ... = ... | main.rs:761:19:761:19 | x | |
| main.rs:760:13:760:13 | y | main.rs:760:13:760:13 | y | |
| main.rs:760:13:760:13 | y | main.rs:768:15:768:15 | y | match |
| main.rs:761:13:767:9 | match x { ... } | main.rs:760:13:760:13 | y | |
| main.rs:761:19:761:19 | x | main.rs:762:13:762:19 | Some(...) | |
| main.rs:762:13:762:19 | Some(...) | main.rs:762:18:762:18 | y | match |
| main.rs:762:13:762:19 | Some(...) | main.rs:765:13:765:16 | None | no-match |
| main.rs:762:18:762:18 | y | main.rs:762:18:762:18 | y | |
| main.rs:762:18:762:18 | y | main.rs:763:17:763:20 | None | match |
| main.rs:762:24:764:13 | { ... } | main.rs:761:13:767:9 | match x { ... } | |
| main.rs:763:17:763:20 | None | main.rs:762:24:764:13 | { ... } | |
| main.rs:765:13:765:16 | None | main.rs:765:13:765:16 | None | |
| main.rs:765:13:765:16 | None | main.rs:766:17:766:20 | None | match |
| main.rs:766:17:766:20 | None | main.rs:761:13:767:9 | match x { ... } | |
| main.rs:768:9:771:9 | match y { ... } | main.rs:758:34:772:5 | { ... } | |
| main.rs:768:15:768:15 | y | main.rs:769:13:769:16 | N0ne | |
| main.rs:769:13:769:16 | N0ne | main.rs:769:13:769:16 | N0ne | |
| main.rs:769:13:769:16 | N0ne | main.rs:770:17:770:20 | N0ne | match |
| main.rs:770:17:770:20 | N0ne | main.rs:768:9:771:9 | match y { ... } | |
| main.rs:774:5:781:5 | enter fn test2 | main.rs:776:9:777:17 | let ... = test | |
| main.rs:774:5:781:5 | exit fn test2 (normal) | main.rs:774:5:781:5 | exit fn test2 | |
| main.rs:775:31:781:5 | { ... } | main.rs:774:5:781:5 | exit fn test2 (normal) | |
| main.rs:776:9:777:17 | let ... = test | main.rs:777:13:777:16 | test | |
| main.rs:776:13:776:22 | test_alias | main.rs:776:13:776:22 | test_alias | |
| main.rs:776:13:776:22 | test_alias | main.rs:778:9:779:25 | let ... = ... | match |
| main.rs:777:13:777:16 | test | main.rs:776:13:776:22 | test_alias | |
| main.rs:778:9:779:25 | let ... = ... | main.rs:779:13:779:22 | test_alias | |
| main.rs:778:13:778:16 | test | main.rs:778:13:778:16 | test | |
| main.rs:778:13:778:16 | test | main.rs:780:9:780:12 | test | match |
| main.rs:779:13:779:22 | test_alias | main.rs:779:13:779:24 | test_alias(...) | |
| main.rs:779:13:779:24 | test_alias(...) | main.rs:778:13:778:16 | test | |
| main.rs:780:9:780:12 | test | main.rs:775:31:781:5 | { ... } | |
| main.rs:785:5:798:5 | enter fn test3 | main.rs:787:9:787:24 | let ... = ... | |
| main.rs:785:5:798:5 | exit fn test3 (normal) | main.rs:785:5:798:5 | exit fn test3 | |
| main.rs:786:16:798:5 | { ... } | main.rs:785:5:798:5 | exit fn test3 (normal) | |
| main.rs:787:9:787:24 | let ... = ... | main.rs:787:17:787:20 | Some | |
| main.rs:787:13:787:13 | x | main.rs:787:13:787:13 | x | |
| main.rs:787:13:787:13 | x | main.rs:788:9:792:10 | ExprStmt | match |
| main.rs:787:17:787:20 | Some | main.rs:787:22:787:22 | 0 | |
| main.rs:787:17:787:23 | Some(...) | main.rs:787:13:787:13 | x | |
| main.rs:787:22:787:22 | 0 | main.rs:787:17:787:23 | Some(...) | |
| main.rs:788:9:792:9 | match x { ... } | main.rs:793:9:797:10 | ExprStmt | |
| main.rs:788:9:792:10 | ExprStmt | main.rs:788:15:788:15 | x | |
| main.rs:788:15:788:15 | x | main.rs:789:13:789:19 | Some(...) | |
| main.rs:789:13:789:19 | Some(...) | main.rs:789:18:789:18 | x | match |
| main.rs:789:13:789:19 | Some(...) | main.rs:791:13:791:13 | _ | no-match |
| main.rs:789:18:789:18 | x | main.rs:789:18:789:18 | x | |
| main.rs:789:18:789:18 | x | main.rs:790:20:790:20 | x | match |
| main.rs:790:20:790:20 | x | main.rs:788:9:792:9 | match x { ... } | |
| main.rs:791:13:791:13 | _ | main.rs:791:18:791:18 | 0 | match |
| main.rs:791:18:791:18 | 0 | main.rs:788:9:792:9 | match x { ... } | |
| main.rs:793:9:797:9 | match x { ... } | main.rs:786:16:798:5 | { ... } | |
| main.rs:793:9:797:10 | ExprStmt | main.rs:793:15:793:15 | x | |
| main.rs:793:15:793:15 | x | main.rs:794:13:794:19 | Some(...) | |
| main.rs:794:13:794:19 | Some(...) | main.rs:794:18:794:18 | z | match |
| main.rs:794:13:794:19 | Some(...) | main.rs:796:13:796:13 | _ | no-match |
| main.rs:794:18:794:18 | z | main.rs:794:18:794:18 | z | |
| main.rs:794:18:794:18 | z | main.rs:795:17:795:17 | z | match |
| main.rs:794:18:794:18 | z | main.rs:796:13:796:13 | _ | no-match |
| main.rs:795:17:795:17 | z | main.rs:793:9:797:9 | match x { ... } | |
| main.rs:796:13:796:13 | _ | main.rs:796:18:796:18 | 0 | match |
| main.rs:796:18:796:18 | 0 | main.rs:793:9:797:9 | match x { ... } | |
| main.rs:801:1:845:1 | enter fn main | main.rs:802:5:802:25 | ExprStmt | |
| main.rs:801:1:845:1 | exit fn main (normal) | main.rs:801:1:845:1 | exit fn main | |
| main.rs:801:11:845:1 | { ... } | main.rs:801:1:845:1 | exit fn main (normal) | |
| main.rs:802:5:802:22 | immutable_variable | main.rs:802:5:802:24 | immutable_variable(...) | |
| main.rs:802:5:802:24 | immutable_variable(...) | main.rs:803:5:803:23 | ExprStmt | |
| main.rs:802:5:802:25 | ExprStmt | main.rs:802:5:802:22 | immutable_variable | |
| main.rs:803:5:803:20 | mutable_variable | main.rs:803:5:803:22 | mutable_variable(...) | |
| main.rs:803:5:803:22 | mutable_variable(...) | main.rs:804:5:804:40 | ExprStmt | |
| main.rs:803:5:803:23 | ExprStmt | main.rs:803:5:803:20 | mutable_variable | |
| main.rs:804:5:804:37 | mutable_variable_immutable_borrow | main.rs:804:5:804:39 | mutable_variable_immutable_borrow(...) | |
| main.rs:804:5:804:39 | mutable_variable_immutable_borrow(...) | main.rs:805:5:805:23 | ExprStmt | |
| main.rs:804:5:804:40 | ExprStmt | main.rs:804:5:804:37 | mutable_variable_immutable_borrow | |
| main.rs:805:5:805:20 | variable_shadow1 | main.rs:805:5:805:22 | variable_shadow1(...) | |
| main.rs:805:5:805:22 | variable_shadow1(...) | main.rs:806:5:806:23 | ExprStmt | |
| main.rs:805:5:805:23 | ExprStmt | main.rs:805:5:805:20 | variable_shadow1 | |
| main.rs:806:5:806:20 | variable_shadow2 | main.rs:806:5:806:22 | variable_shadow2(...) | |
| main.rs:806:5:806:22 | variable_shadow2(...) | main.rs:807:5:807:19 | ExprStmt | |
| main.rs:806:5:806:23 | ExprStmt | main.rs:806:5:806:20 | variable_shadow2 | |
| main.rs:807:5:807:16 | let_pattern1 | main.rs:807:5:807:18 | let_pattern1(...) | |
| main.rs:807:5:807:18 | let_pattern1(...) | main.rs:808:5:808:19 | ExprStmt | |
| main.rs:807:5:807:19 | ExprStmt | main.rs:807:5:807:16 | let_pattern1 | |
| main.rs:808:5:808:16 | let_pattern2 | main.rs:808:5:808:18 | let_pattern2(...) | |
| main.rs:808:5:808:18 | let_pattern2(...) | main.rs:809:5:809:19 | ExprStmt | |
| main.rs:808:5:808:19 | ExprStmt | main.rs:808:5:808:16 | let_pattern2 | |
| main.rs:809:5:809:16 | let_pattern3 | main.rs:809:5:809:18 | let_pattern3(...) | |
| main.rs:809:5:809:18 | let_pattern3(...) | main.rs:810:5:810:19 | ExprStmt | |
| main.rs:809:5:809:19 | ExprStmt | main.rs:809:5:809:16 | let_pattern3 | |
| main.rs:810:5:810:16 | let_pattern4 | main.rs:810:5:810:18 | let_pattern4(...) | |
| main.rs:810:5:810:18 | let_pattern4(...) | main.rs:811:5:811:21 | ExprStmt | |
| main.rs:810:5:810:19 | ExprStmt | main.rs:810:5:810:16 | let_pattern4 | |
| main.rs:811:5:811:18 | match_pattern1 | main.rs:811:5:811:20 | match_pattern1(...) | |
| main.rs:811:5:811:20 | match_pattern1(...) | main.rs:812:5:812:21 | ExprStmt | |
| main.rs:811:5:811:21 | ExprStmt | main.rs:811:5:811:18 | match_pattern1 | |
| main.rs:812:5:812:18 | match_pattern2 | main.rs:812:5:812:20 | match_pattern2(...) | |
| main.rs:812:5:812:20 | match_pattern2(...) | main.rs:813:5:813:21 | ExprStmt | |
| main.rs:812:5:812:21 | ExprStmt | main.rs:812:5:812:18 | match_pattern2 | |
| main.rs:813:5:813:18 | match_pattern3 | main.rs:813:5:813:20 | match_pattern3(...) | |
| main.rs:813:5:813:20 | match_pattern3(...) | main.rs:814:5:814:21 | ExprStmt | |
| main.rs:813:5:813:21 | ExprStmt | main.rs:813:5:813:18 | match_pattern3 | |
| main.rs:814:5:814:18 | match_pattern4 | main.rs:814:5:814:20 | match_pattern4(...) | |
| main.rs:814:5:814:20 | match_pattern4(...) | main.rs:815:5:815:21 | ExprStmt | |
| main.rs:814:5:814:21 | ExprStmt | main.rs:814:5:814:18 | match_pattern4 | |
| main.rs:815:5:815:18 | match_pattern5 | main.rs:815:5:815:20 | match_pattern5(...) | |
| main.rs:815:5:815:20 | match_pattern5(...) | main.rs:816:5:816:21 | ExprStmt | |
| main.rs:815:5:815:21 | ExprStmt | main.rs:815:5:815:18 | match_pattern5 | |
| main.rs:816:5:816:18 | match_pattern6 | main.rs:816:5:816:20 | match_pattern6(...) | |
| main.rs:816:5:816:20 | match_pattern6(...) | main.rs:817:5:817:21 | ExprStmt | |
| main.rs:816:5:816:21 | ExprStmt | main.rs:816:5:816:18 | match_pattern6 | |
| main.rs:817:5:817:18 | match_pattern7 | main.rs:817:5:817:20 | match_pattern7(...) | |
| main.rs:817:5:817:20 | match_pattern7(...) | main.rs:818:5:818:21 | ExprStmt | |
| main.rs:817:5:817:21 | ExprStmt | main.rs:817:5:817:18 | match_pattern7 | |
| main.rs:818:5:818:18 | match_pattern8 | main.rs:818:5:818:20 | match_pattern8(...) | |
| main.rs:818:5:818:20 | match_pattern8(...) | main.rs:819:5:819:21 | ExprStmt | |
| main.rs:818:5:818:21 | ExprStmt | main.rs:818:5:818:18 | match_pattern8 | |
| main.rs:819:5:819:18 | match_pattern9 | main.rs:819:5:819:20 | match_pattern9(...) | |
| main.rs:819:5:819:20 | match_pattern9(...) | main.rs:820:5:820:22 | ExprStmt | |
| main.rs:819:5:819:21 | ExprStmt | main.rs:819:5:819:18 | match_pattern9 | |
| main.rs:820:5:820:19 | match_pattern10 | main.rs:820:5:820:21 | match_pattern10(...) | |
| main.rs:820:5:820:21 | match_pattern10(...) | main.rs:821:5:821:22 | ExprStmt | |
| main.rs:820:5:820:22 | ExprStmt | main.rs:820:5:820:19 | match_pattern10 | |
| main.rs:821:5:821:19 | match_pattern11 | main.rs:821:5:821:21 | match_pattern11(...) | |
| main.rs:821:5:821:21 | match_pattern11(...) | main.rs:822:5:822:22 | ExprStmt | |
| main.rs:821:5:821:22 | ExprStmt | main.rs:821:5:821:19 | match_pattern11 | |
| main.rs:822:5:822:19 | match_pattern12 | main.rs:822:5:822:21 | match_pattern12(...) | |
| main.rs:822:5:822:21 | match_pattern12(...) | main.rs:823:5:823:22 | ExprStmt | |
| main.rs:822:5:822:22 | ExprStmt | main.rs:822:5:822:19 | match_pattern12 | |
| main.rs:823:5:823:19 | match_pattern13 | main.rs:823:5:823:21 | match_pattern13(...) | |
| main.rs:823:5:823:21 | match_pattern13(...) | main.rs:824:5:824:22 | ExprStmt | |
| main.rs:823:5:823:22 | ExprStmt | main.rs:823:5:823:19 | match_pattern13 | |
| main.rs:824:5:824:19 | match_pattern14 | main.rs:824:5:824:21 | match_pattern14(...) | |
| main.rs:824:5:824:21 | match_pattern14(...) | main.rs:825:5:825:22 | ExprStmt | |
| main.rs:824:5:824:22 | ExprStmt | main.rs:824:5:824:19 | match_pattern14 | |
| main.rs:825:5:825:19 | match_pattern15 | main.rs:825:5:825:21 | match_pattern15(...) | |
| main.rs:825:5:825:21 | match_pattern15(...) | main.rs:826:5:826:22 | ExprStmt | |
| main.rs:825:5:825:22 | ExprStmt | main.rs:825:5:825:19 | match_pattern15 | |
| main.rs:826:5:826:19 | match_pattern16 | main.rs:826:5:826:21 | match_pattern16(...) | |
| main.rs:826:5:826:21 | match_pattern16(...) | main.rs:827:5:827:36 | ExprStmt | |
| main.rs:826:5:826:22 | ExprStmt | main.rs:826:5:826:19 | match_pattern16 | |
| main.rs:827:5:827:18 | param_pattern1 | main.rs:827:20:827:22 | "a" | |
| main.rs:827:5:827:35 | param_pattern1(...) | main.rs:828:5:828:37 | ExprStmt | |
| main.rs:827:5:827:36 | ExprStmt | main.rs:827:5:827:18 | param_pattern1 | |
| main.rs:827:20:827:22 | "a" | main.rs:827:26:827:28 | "b" | |
| main.rs:827:25:827:34 | TupleExpr | main.rs:827:5:827:35 | param_pattern1(...) | |
| main.rs:827:26:827:28 | "b" | main.rs:827:31:827:33 | "c" | |
| main.rs:827:31:827:33 | "c" | main.rs:827:25:827:34 | TupleExpr | |
| main.rs:828:5:828:18 | param_pattern2 | main.rs:828:20:828:31 | ...::Left | |
| main.rs:828:5:828:36 | param_pattern2(...) | main.rs:829:5:829:26 | ExprStmt | |
| main.rs:828:5:828:37 | ExprStmt | main.rs:828:5:828:18 | param_pattern2 | |
| main.rs:828:20:828:31 | ...::Left | main.rs:828:33:828:34 | 45 | |
| main.rs:828:20:828:35 | ...::Left(...) | main.rs:828:5:828:36 | param_pattern2(...) | |
| main.rs:828:33:828:34 | 45 | main.rs:828:20:828:35 | ...::Left(...) | |
| main.rs:829:5:829:23 | destruct_assignment | main.rs:829:5:829:25 | destruct_assignment(...) | |
| main.rs:829:5:829:25 | destruct_assignment(...) | main.rs:830:5:830:23 | ExprStmt | |
| main.rs:829:5:829:26 | ExprStmt | main.rs:829:5:829:23 | destruct_assignment | |
| main.rs:830:5:830:20 | closure_variable | main.rs:830:5:830:22 | closure_variable(...) | |
| main.rs:830:5:830:22 | closure_variable(...) | main.rs:831:5:831:22 | ExprStmt | |
| main.rs:830:5:830:23 | ExprStmt | main.rs:830:5:830:20 | closure_variable | |
| main.rs:831:5:831:19 | nested_function | main.rs:831:5:831:21 | nested_function(...) | |
| main.rs:831:5:831:21 | nested_function(...) | main.rs:832:5:832:19 | ExprStmt | |
| main.rs:831:5:831:22 | ExprStmt | main.rs:831:5:831:19 | nested_function | |
| main.rs:832:5:832:16 | for_variable | main.rs:832:5:832:18 | for_variable(...) | |
| main.rs:832:5:832:18 | for_variable(...) | main.rs:833:5:833:17 | ExprStmt | |
| main.rs:832:5:832:19 | ExprStmt | main.rs:832:5:832:16 | for_variable | |
| main.rs:833:5:833:14 | add_assign | main.rs:833:5:833:16 | add_assign(...) | |
| main.rs:833:5:833:16 | add_assign(...) | main.rs:834:5:834:13 | ExprStmt | |
| main.rs:833:5:833:17 | ExprStmt | main.rs:833:5:833:14 | add_assign | |
| main.rs:834:5:834:10 | mutate | main.rs:834:5:834:12 | mutate(...) | |
| main.rs:834:5:834:12 | mutate(...) | main.rs:835:5:835:17 | ExprStmt | |
| main.rs:834:5:834:13 | ExprStmt | main.rs:834:5:834:10 | mutate | |
| main.rs:835:5:835:14 | mutate_arg | main.rs:835:5:835:16 | mutate_arg(...) | |
| main.rs:835:5:835:16 | mutate_arg(...) | main.rs:836:5:836:12 | ExprStmt | |
| main.rs:835:5:835:17 | ExprStmt | main.rs:835:5:835:14 | mutate_arg | |
| main.rs:836:5:836:9 | alias | main.rs:836:5:836:11 | alias(...) | |
| main.rs:836:5:836:11 | alias(...) | main.rs:837:5:837:18 | ExprStmt | |
| main.rs:836:5:836:12 | ExprStmt | main.rs:836:5:836:9 | alias | |
| main.rs:837:5:837:15 | capture_mut | main.rs:837:5:837:17 | capture_mut(...) | |
| main.rs:837:5:837:17 | capture_mut(...) | main.rs:838:5:838:20 | ExprStmt | |
| main.rs:837:5:837:18 | ExprStmt | main.rs:837:5:837:15 | capture_mut | |
| main.rs:838:5:838:17 | capture_immut | main.rs:838:5:838:19 | capture_immut(...) | |
| main.rs:838:5:838:19 | capture_immut(...) | main.rs:839:5:839:26 | ExprStmt | |
| main.rs:838:5:838:20 | ExprStmt | main.rs:838:5:838:17 | capture_immut | |
| main.rs:839:5:839:23 | async_block_capture | main.rs:839:5:839:25 | async_block_capture(...) | |
| main.rs:839:5:839:25 | async_block_capture(...) | main.rs:840:5:840:14 | ExprStmt | |
| main.rs:839:5:839:26 | ExprStmt | main.rs:839:5:839:23 | async_block_capture | |
| main.rs:840:5:840:11 | structs | main.rs:840:5:840:13 | structs(...) | |
| main.rs:840:5:840:13 | structs(...) | main.rs:841:5:841:14 | ExprStmt | |
| main.rs:840:5:840:14 | ExprStmt | main.rs:840:5:840:11 | structs | |
| main.rs:841:5:841:11 | ref_arg | main.rs:841:5:841:13 | ref_arg(...) | |
| main.rs:841:5:841:13 | ref_arg(...) | main.rs:842:5:842:30 | ExprStmt | |
| main.rs:841:5:841:14 | ExprStmt | main.rs:841:5:841:11 | ref_arg | |
| main.rs:842:5:842:27 | ref_methodcall_receiver | main.rs:842:5:842:29 | ref_methodcall_receiver(...) | |
| main.rs:842:5:842:29 | ref_methodcall_receiver(...) | main.rs:843:5:843:23 | ExprStmt | |
| main.rs:842:5:842:30 | ExprStmt | main.rs:842:5:842:27 | ref_methodcall_receiver | |
| main.rs:843:5:843:20 | macro_invocation | main.rs:843:5:843:22 | macro_invocation(...) | |
| main.rs:843:5:843:22 | macro_invocation(...) | main.rs:844:5:844:18 | ExprStmt | |
| main.rs:843:5:843:23 | ExprStmt | main.rs:843:5:843:20 | macro_invocation | |
| main.rs:844:5:844:15 | capture_phi | main.rs:844:5:844:17 | capture_phi(...) | |
| main.rs:844:5:844:17 | capture_phi(...) | main.rs:801:11:845:1 | { ... } | |
| main.rs:844:5:844:18 | ExprStmt | main.rs:844:5:844:15 | capture_phi | |
breakTarget
| main.rs:326:9:326:13 | break | main.rs:317:5:327:5 | while ... { ... } |
continueTarget

View File

@@ -196,6 +196,13 @@ definition
| main.rs:748:17:750:9 | SSA phi(x) | main.rs:745:13:745:13 | x |
| main.rs:749:13:749:13 | x | main.rs:745:13:745:13 | x |
| main.rs:752:5:752:13 | <captured exit> x | main.rs:745:13:745:13 | x |
| main.rs:759:13:759:13 | x | main.rs:759:13:759:13 | x |
| main.rs:760:13:760:13 | y | main.rs:760:13:760:13 | y |
| main.rs:769:13:769:16 | N0ne | main.rs:769:13:769:16 | N0ne |
| main.rs:776:13:776:22 | test_alias | main.rs:776:13:776:22 | test_alias |
| main.rs:778:13:778:16 | test | main.rs:778:13:778:16 | test |
| main.rs:787:13:787:13 | x | main.rs:787:13:787:13 | x |
| main.rs:789:18:789:18 | x | main.rs:789:18:789:18 | x |
read
| main.rs:5:14:5:14 | s | main.rs:5:14:5:14 | s | main.rs:7:20:7:20 | s |
| main.rs:10:14:10:14 | i | main.rs:10:14:10:14 | i | main.rs:12:20:12:20 | i |
@@ -404,6 +411,14 @@ read
| main.rs:746:13:746:15 | cap | main.rs:746:13:746:15 | cap | main.rs:752:5:752:7 | cap |
| main.rs:746:20:746:20 | b | main.rs:746:20:746:20 | b | main.rs:748:20:748:20 | b |
| main.rs:752:5:752:13 | <captured exit> x | main.rs:745:13:745:13 | x | main.rs:753:15:753:15 | x |
| main.rs:759:13:759:13 | x | main.rs:759:13:759:13 | x | main.rs:761:19:761:19 | x |
| main.rs:760:13:760:13 | y | main.rs:760:13:760:13 | y | main.rs:768:15:768:15 | y |
| main.rs:769:13:769:16 | N0ne | main.rs:769:13:769:16 | N0ne | main.rs:770:17:770:20 | N0ne |
| main.rs:776:13:776:22 | test_alias | main.rs:776:13:776:22 | test_alias | main.rs:779:13:779:22 | test_alias |
| main.rs:778:13:778:16 | test | main.rs:778:13:778:16 | test | main.rs:780:9:780:12 | test |
| main.rs:787:13:787:13 | x | main.rs:787:13:787:13 | x | main.rs:788:15:788:15 | x |
| main.rs:787:13:787:13 | x | main.rs:787:13:787:13 | x | main.rs:793:15:793:15 | x |
| main.rs:789:18:789:18 | x | main.rs:789:18:789:18 | x | main.rs:790:20:790:20 | x |
firstRead
| main.rs:5:14:5:14 | s | main.rs:5:14:5:14 | s | main.rs:7:20:7:20 | s |
| main.rs:10:14:10:14 | i | main.rs:10:14:10:14 | i | main.rs:12:20:12:20 | i |
@@ -570,6 +585,13 @@ firstRead
| main.rs:746:13:746:15 | cap | main.rs:746:13:746:15 | cap | main.rs:752:5:752:7 | cap |
| main.rs:746:20:746:20 | b | main.rs:746:20:746:20 | b | main.rs:748:20:748:20 | b |
| main.rs:752:5:752:13 | <captured exit> x | main.rs:745:13:745:13 | x | main.rs:753:15:753:15 | x |
| main.rs:759:13:759:13 | x | main.rs:759:13:759:13 | x | main.rs:761:19:761:19 | x |
| main.rs:760:13:760:13 | y | main.rs:760:13:760:13 | y | main.rs:768:15:768:15 | y |
| main.rs:769:13:769:16 | N0ne | main.rs:769:13:769:16 | N0ne | main.rs:770:17:770:20 | N0ne |
| main.rs:776:13:776:22 | test_alias | main.rs:776:13:776:22 | test_alias | main.rs:779:13:779:22 | test_alias |
| main.rs:778:13:778:16 | test | main.rs:778:13:778:16 | test | main.rs:780:9:780:12 | test |
| main.rs:787:13:787:13 | x | main.rs:787:13:787:13 | x | main.rs:788:15:788:15 | x |
| main.rs:789:18:789:18 | x | main.rs:789:18:789:18 | x | main.rs:790:20:790:20 | x |
adjacentReads
| main.rs:27:5:27:6 | x2 | main.rs:25:13:25:14 | x2 | main.rs:28:15:28:16 | x2 | main.rs:29:10:29:11 | x2 |
| main.rs:41:9:41:10 | x3 | main.rs:41:9:41:10 | x3 | main.rs:42:15:42:16 | x3 | main.rs:44:9:44:10 | x3 |
@@ -616,6 +638,7 @@ adjacentReads
| main.rs:676:13:676:13 | a | main.rs:676:13:676:13 | a | main.rs:677:15:677:15 | a | main.rs:678:5:678:5 | a |
| main.rs:676:13:676:13 | a | main.rs:676:13:676:13 | a | main.rs:678:5:678:5 | a | main.rs:679:15:679:15 | a |
| main.rs:685:9:685:9 | x | main.rs:685:9:685:9 | x | main.rs:686:20:686:20 | x | main.rs:687:15:687:15 | x |
| main.rs:787:13:787:13 | x | main.rs:787:13:787:13 | x | main.rs:788:15:788:15 | x | main.rs:793:15:793:15 | x |
phi
| main.rs:210:9:210:44 | SSA phi(a3) | main.rs:210:9:210:44 | a3 | main.rs:210:22:210:23 | a3 |
| main.rs:210:9:210:44 | SSA phi(a3) | main.rs:210:9:210:44 | a3 | main.rs:210:42:210:43 | a3 |
@@ -773,3 +796,8 @@ assigns
| main.rs:745:13:745:13 | x | main.rs:745:17:745:19 | 100 |
| main.rs:746:13:746:15 | cap | main.rs:746:19:751:5 | \|...\| ... |
| main.rs:749:13:749:13 | x | main.rs:749:17:749:19 | 200 |
| main.rs:759:13:759:13 | x | main.rs:759:17:759:24 | Some(...) |
| main.rs:760:13:760:13 | y | main.rs:761:13:767:9 | match x { ... } |
| main.rs:776:13:776:22 | test_alias | main.rs:777:13:777:16 | test |
| main.rs:778:13:778:16 | test | main.rs:779:13:779:24 | test_alias(...) |
| main.rs:787:13:787:13 | x | main.rs:787:17:787:23 | Some(...) |

View File

@@ -753,6 +753,51 @@ fn capture_phi() {
print_i64(x); // $ read_access=x
}
mod patterns {
#[rustfmt::skip]
pub fn test() -> Option<i32> {
let x = Some(42); // x
let y : Option<i32> = // y1
match x { // $ read_access=x
Some(y) => { // y2
None
}
None =>
None
};
match y { // $ read_access=y1
N0ne => // n0ne
N0ne // $ read_access=n0ne
}
}
#[rustfmt::skip]
fn test2() -> Option<i32> {
let test_alias = // test_alias
test;
let test = // test
test_alias(); // $ read_access=test_alias
test // $ read_access=test
}
const z: i32 = 0;
#[rustfmt::skip]
fn test3() {
let x = Some(0); // x1
match x { // $ read_access=x1
Some(x) // x2
=> x, // $ read_access=x2
_ => 0
};
match x { // $ read_access=x1
Some(z) =>
z,
_ => 0
};
}
}
fn main() {
immutable_variable();
mutable_variable();

View File

@@ -142,6 +142,14 @@ variable
| main.rs:745:13:745:13 | x |
| main.rs:746:13:746:15 | cap |
| main.rs:746:20:746:20 | b |
| main.rs:759:13:759:13 | x |
| main.rs:760:13:760:13 | y |
| main.rs:762:18:762:18 | y |
| main.rs:769:13:769:16 | N0ne |
| main.rs:776:13:776:22 | test_alias |
| main.rs:778:13:778:16 | test |
| main.rs:787:13:787:13 | x |
| main.rs:789:18:789:18 | x |
variableAccess
| main.rs:7:20:7:20 | s | main.rs:5:14:5:14 | s |
| main.rs:12:20:12:20 | i | main.rs:10:14:10:14 | i |
@@ -364,6 +372,14 @@ variableAccess
| main.rs:749:13:749:13 | x | main.rs:745:13:745:13 | x |
| main.rs:752:5:752:7 | cap | main.rs:746:13:746:15 | cap |
| main.rs:753:15:753:15 | x | main.rs:745:13:745:13 | x |
| main.rs:761:19:761:19 | x | main.rs:759:13:759:13 | x |
| main.rs:768:15:768:15 | y | main.rs:760:13:760:13 | y |
| main.rs:770:17:770:20 | N0ne | main.rs:769:13:769:16 | N0ne |
| main.rs:779:13:779:22 | test_alias | main.rs:776:13:776:22 | test_alias |
| main.rs:780:9:780:12 | test | main.rs:778:13:778:16 | test |
| main.rs:788:15:788:15 | x | main.rs:787:13:787:13 | x |
| main.rs:790:20:790:20 | x | main.rs:789:18:789:18 | x |
| main.rs:793:15:793:15 | x | main.rs:787:13:787:13 | x |
variableWriteAccess
| main.rs:27:5:27:6 | x2 | main.rs:25:13:25:14 | x2 |
| main.rs:29:5:29:6 | x2 | main.rs:25:13:25:14 | x2 |
@@ -576,6 +592,14 @@ variableReadAccess
| main.rs:748:20:748:20 | b | main.rs:746:20:746:20 | b |
| main.rs:752:5:752:7 | cap | main.rs:746:13:746:15 | cap |
| main.rs:753:15:753:15 | x | main.rs:745:13:745:13 | x |
| main.rs:761:19:761:19 | x | main.rs:759:13:759:13 | x |
| main.rs:768:15:768:15 | y | main.rs:760:13:760:13 | y |
| main.rs:770:17:770:20 | N0ne | main.rs:769:13:769:16 | N0ne |
| main.rs:779:13:779:22 | test_alias | main.rs:776:13:776:22 | test_alias |
| main.rs:780:9:780:12 | test | main.rs:778:13:778:16 | test |
| main.rs:788:15:788:15 | x | main.rs:787:13:787:13 | x |
| main.rs:790:20:790:20 | x | main.rs:789:18:789:18 | x |
| main.rs:793:15:793:15 | x | main.rs:787:13:787:13 | x |
variableInitializer
| main.rs:20:9:20:10 | x1 | main.rs:20:14:20:16 | "a" |
| main.rs:25:13:25:14 | x2 | main.rs:25:18:25:18 | 4 |
@@ -649,6 +673,11 @@ variableInitializer
| main.rs:734:15:734:28 | var_in_macro | main.rs:734:15:734:28 | 0 |
| main.rs:745:13:745:13 | x | main.rs:745:17:745:19 | 100 |
| main.rs:746:13:746:15 | cap | main.rs:746:19:751:5 | \|...\| ... |
| main.rs:759:13:759:13 | x | main.rs:759:17:759:24 | Some(...) |
| main.rs:760:13:760:13 | y | main.rs:761:13:767:9 | match x { ... } |
| main.rs:776:13:776:22 | test_alias | main.rs:777:13:777:16 | test |
| main.rs:778:13:778:16 | test | main.rs:779:13:779:24 | test_alias(...) |
| main.rs:787:13:787:13 | x | main.rs:787:17:787:23 | Some(...) |
capturedVariable
| main.rs:557:9:557:9 | x |
| main.rs:568:13:568:13 | x |

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,129 @@
#select
| main.rs:4:4:4:30 | danger_accept_invalid_certs | main.rs:4:32:4:35 | true | main.rs:4:4:4:30 | danger_accept_invalid_certs | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:9:4:9:34 | danger_accept_invalid_hostnames | main.rs:9:36:9:39 | true | main.rs:9:4:9:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:16:4:16:30 | danger_accept_invalid_certs | main.rs:16:32:16:35 | true | main.rs:16:4:16:30 | danger_accept_invalid_certs | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:17:4:17:34 | danger_accept_invalid_hostnames | main.rs:17:36:17:39 | true | main.rs:17:4:17:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:37:4:37:30 | danger_accept_invalid_certs | main.rs:37:32:37:35 | true | main.rs:37:4:37:30 | danger_accept_invalid_certs | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:42:4:42:34 | danger_accept_invalid_hostnames | main.rs:42:36:42:39 | true | main.rs:42:4:42:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:47:4:47:30 | danger_accept_invalid_certs | main.rs:47:32:47:35 | true | main.rs:47:4:47:30 | danger_accept_invalid_certs | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:48:4:48:34 | danger_accept_invalid_hostnames | main.rs:48:36:48:39 | true | main.rs:48:4:48:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:55:4:55:30 | danger_accept_invalid_certs | main.rs:55:32:55:35 | true | main.rs:55:4:55:30 | danger_accept_invalid_certs | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:56:4:56:34 | danger_accept_invalid_hostnames | main.rs:56:36:56:39 | true | main.rs:56:4:56:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:83:4:83:30 | danger_accept_invalid_certs | main.rs:74:15:74:18 | true | main.rs:83:4:83:30 | danger_accept_invalid_certs | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:88:4:88:30 | danger_accept_invalid_certs | main.rs:75:22:75:25 | true | main.rs:88:4:88:30 | danger_accept_invalid_certs | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:93:4:93:30 | danger_accept_invalid_certs | main.rs:154:17:154:20 | true | main.rs:93:4:93:30 | danger_accept_invalid_certs | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:109:4:109:34 | danger_accept_invalid_hostnames | main.rs:107:17:107:31 | ...::exists | main.rs:109:4:109:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:115:4:115:34 | danger_accept_invalid_hostnames | main.rs:113:43:113:50 | metadata | main.rs:115:4:115:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:121:4:121:34 | danger_accept_invalid_hostnames | main.rs:119:11:119:27 | ...::metadata | main.rs:121:4:121:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
| main.rs:146:4:146:34 | danger_accept_invalid_hostnames | main.rs:144:39:144:42 | true | main.rs:146:4:146:34 | danger_accept_invalid_hostnames | Disabling TLS certificate validation can expose the application to man-in-the-middle attacks. |
edges
| main.rs:4:32:4:35 | true | main.rs:4:4:4:30 | danger_accept_invalid_certs | provenance | MaD:1 Sink:MaD:1 |
| main.rs:9:36:9:39 | true | main.rs:9:4:9:34 | danger_accept_invalid_hostnames | provenance | MaD:2 Sink:MaD:2 |
| main.rs:16:32:16:35 | true | main.rs:16:4:16:30 | danger_accept_invalid_certs | provenance | MaD:1 Sink:MaD:1 |
| main.rs:17:36:17:39 | true | main.rs:17:4:17:34 | danger_accept_invalid_hostnames | provenance | MaD:2 Sink:MaD:2 |
| main.rs:37:32:37:35 | true | main.rs:37:4:37:30 | danger_accept_invalid_certs | provenance | MaD:3 Sink:MaD:3 |
| main.rs:42:36:42:39 | true | main.rs:42:4:42:34 | danger_accept_invalid_hostnames | provenance | MaD:6 Sink:MaD:6 |
| main.rs:47:32:47:35 | true | main.rs:47:4:47:30 | danger_accept_invalid_certs | provenance | MaD:3 Sink:MaD:3 |
| main.rs:48:36:48:39 | true | main.rs:48:4:48:34 | danger_accept_invalid_hostnames | provenance | MaD:4 Sink:MaD:4 |
| main.rs:55:32:55:35 | true | main.rs:55:4:55:30 | danger_accept_invalid_certs | provenance | MaD:5 Sink:MaD:5 |
| main.rs:56:36:56:39 | true | main.rs:56:4:56:34 | danger_accept_invalid_hostnames | provenance | MaD:6 Sink:MaD:6 |
| main.rs:73:19:73:40 | ...: bool | main.rs:93:32:93:47 | sometimes_global | provenance | |
| main.rs:74:6:74:11 | always | main.rs:83:32:83:37 | always | provenance | |
| main.rs:74:15:74:18 | true | main.rs:74:6:74:11 | always | provenance | |
| main.rs:75:6:75:18 | mut sometimes | main.rs:88:32:88:40 | sometimes | provenance | |
| main.rs:75:22:75:25 | true | main.rs:75:6:75:18 | mut sometimes | provenance | |
| main.rs:83:32:83:37 | always | main.rs:83:4:83:30 | danger_accept_invalid_certs | provenance | MaD:1 Sink:MaD:1 |
| main.rs:88:32:88:40 | sometimes | main.rs:88:4:88:30 | danger_accept_invalid_certs | provenance | MaD:1 Sink:MaD:1 |
| main.rs:93:32:93:47 | sometimes_global | main.rs:93:4:93:30 | danger_accept_invalid_certs | provenance | MaD:1 Sink:MaD:1 |
| main.rs:107:6:107:7 | b1 | main.rs:109:36:109:37 | b1 | provenance | |
| main.rs:107:17:107:31 | ...::exists | main.rs:107:17:107:42 | ...::exists(...) [Ok] | provenance | Src:MaD:8 |
| main.rs:107:17:107:42 | ...::exists(...) [Ok] | main.rs:107:17:107:51 | ... .unwrap() | provenance | MaD:10 |
| main.rs:107:17:107:51 | ... .unwrap() | main.rs:107:6:107:7 | b1 | provenance | |
| main.rs:109:36:109:37 | b1 | main.rs:109:4:109:34 | danger_accept_invalid_hostnames | provenance | MaD:2 Sink:MaD:2 |
| main.rs:113:6:113:7 | b2 | main.rs:115:36:115:37 | b2 | provenance | |
| main.rs:113:11:113:52 | ... .metadata() [Ok] | main.rs:113:11:113:61 | ... .unwrap() | provenance | MaD:10 |
| main.rs:113:11:113:61 | ... .unwrap() | main.rs:113:11:113:71 | ... .is_file() | provenance | MaD:12 |
| main.rs:113:11:113:71 | ... .is_file() | main.rs:113:6:113:7 | b2 | provenance | |
| main.rs:113:43:113:50 | metadata | main.rs:113:11:113:52 | ... .metadata() [Ok] | provenance | Src:MaD:7 |
| main.rs:115:36:115:37 | b2 | main.rs:115:4:115:34 | danger_accept_invalid_hostnames | provenance | MaD:2 Sink:MaD:2 |
| main.rs:119:6:119:7 | b3 | main.rs:121:36:121:37 | b3 | provenance | |
| main.rs:119:11:119:27 | ...::metadata | main.rs:119:11:119:38 | ...::metadata(...) [Ok] | provenance | Src:MaD:9 |
| main.rs:119:11:119:38 | ...::metadata(...) [Ok] | main.rs:119:11:119:47 | ... .unwrap() | provenance | MaD:10 |
| main.rs:119:11:119:47 | ... .unwrap() | main.rs:119:11:119:56 | ... .is_dir() | provenance | MaD:11 |
| main.rs:119:11:119:56 | ... .is_dir() | main.rs:119:6:119:7 | b3 | provenance | |
| main.rs:121:36:121:37 | b3 | main.rs:121:4:121:34 | danger_accept_invalid_hostnames | provenance | MaD:2 Sink:MaD:2 |
| main.rs:144:6:144:7 | b6 | main.rs:146:36:146:37 | b6 | provenance | |
| main.rs:144:39:144:42 | true | main.rs:144:6:144:7 | b6 | provenance | |
| main.rs:146:36:146:37 | b6 | main.rs:146:4:146:34 | danger_accept_invalid_hostnames | provenance | MaD:2 Sink:MaD:2 |
| main.rs:154:17:154:20 | true | main.rs:73:19:73:40 | ...: bool | provenance | |
models
| 1 | Sink: <native_tls::TlsConnectorBuilder>::danger_accept_invalid_certs; Argument[0]; disable-certificate |
| 2 | Sink: <native_tls::TlsConnectorBuilder>::danger_accept_invalid_hostnames; Argument[0]; disable-certificate |
| 3 | Sink: <reqwest::async_impl::client::ClientBuilder>::danger_accept_invalid_certs; Argument[0]; disable-certificate |
| 4 | Sink: <reqwest::async_impl::client::ClientBuilder>::danger_accept_invalid_hostnames; Argument[0]; disable-certificate |
| 5 | Sink: <reqwest::blocking::client::ClientBuilder>::danger_accept_invalid_certs; Argument[0]; disable-certificate |
| 6 | Sink: <reqwest::blocking::client::ClientBuilder>::danger_accept_invalid_hostnames; Argument[0]; disable-certificate |
| 7 | Source: <std::path::Path>::metadata; ReturnValue.Field[core::result::Result::Ok(0)]; file |
| 8 | Source: std::fs::exists; ReturnValue.Field[core::result::Result::Ok(0)]; file |
| 9 | Source: std::fs::metadata; ReturnValue.Field[core::result::Result::Ok(0)]; file |
| 10 | Summary: <core::result::Result>::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value |
| 11 | Summary: <std::fs::Metadata>::is_dir; Argument[self].Reference; ReturnValue; taint |
| 12 | Summary: <std::fs::Metadata>::is_file; Argument[self].Reference; ReturnValue; taint |
nodes
| main.rs:4:4:4:30 | danger_accept_invalid_certs | semmle.label | danger_accept_invalid_certs |
| main.rs:4:32:4:35 | true | semmle.label | true |
| main.rs:9:4:9:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:9:36:9:39 | true | semmle.label | true |
| main.rs:16:4:16:30 | danger_accept_invalid_certs | semmle.label | danger_accept_invalid_certs |
| main.rs:16:32:16:35 | true | semmle.label | true |
| main.rs:17:4:17:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:17:36:17:39 | true | semmle.label | true |
| main.rs:37:4:37:30 | danger_accept_invalid_certs | semmle.label | danger_accept_invalid_certs |
| main.rs:37:32:37:35 | true | semmle.label | true |
| main.rs:42:4:42:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:42:36:42:39 | true | semmle.label | true |
| main.rs:47:4:47:30 | danger_accept_invalid_certs | semmle.label | danger_accept_invalid_certs |
| main.rs:47:32:47:35 | true | semmle.label | true |
| main.rs:48:4:48:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:48:36:48:39 | true | semmle.label | true |
| main.rs:55:4:55:30 | danger_accept_invalid_certs | semmle.label | danger_accept_invalid_certs |
| main.rs:55:32:55:35 | true | semmle.label | true |
| main.rs:56:4:56:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:56:36:56:39 | true | semmle.label | true |
| main.rs:73:19:73:40 | ...: bool | semmle.label | ...: bool |
| main.rs:74:6:74:11 | always | semmle.label | always |
| main.rs:74:15:74:18 | true | semmle.label | true |
| main.rs:75:6:75:18 | mut sometimes | semmle.label | mut sometimes |
| main.rs:75:22:75:25 | true | semmle.label | true |
| main.rs:83:4:83:30 | danger_accept_invalid_certs | semmle.label | danger_accept_invalid_certs |
| main.rs:83:32:83:37 | always | semmle.label | always |
| main.rs:88:4:88:30 | danger_accept_invalid_certs | semmle.label | danger_accept_invalid_certs |
| main.rs:88:32:88:40 | sometimes | semmle.label | sometimes |
| main.rs:93:4:93:30 | danger_accept_invalid_certs | semmle.label | danger_accept_invalid_certs |
| main.rs:93:32:93:47 | sometimes_global | semmle.label | sometimes_global |
| main.rs:107:6:107:7 | b1 | semmle.label | b1 |
| main.rs:107:17:107:31 | ...::exists | semmle.label | ...::exists |
| main.rs:107:17:107:42 | ...::exists(...) [Ok] | semmle.label | ...::exists(...) [Ok] |
| main.rs:107:17:107:51 | ... .unwrap() | semmle.label | ... .unwrap() |
| main.rs:109:4:109:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:109:36:109:37 | b1 | semmle.label | b1 |
| main.rs:113:6:113:7 | b2 | semmle.label | b2 |
| main.rs:113:11:113:52 | ... .metadata() [Ok] | semmle.label | ... .metadata() [Ok] |
| main.rs:113:11:113:61 | ... .unwrap() | semmle.label | ... .unwrap() |
| main.rs:113:11:113:71 | ... .is_file() | semmle.label | ... .is_file() |
| main.rs:113:43:113:50 | metadata | semmle.label | metadata |
| main.rs:115:4:115:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:115:36:115:37 | b2 | semmle.label | b2 |
| main.rs:119:6:119:7 | b3 | semmle.label | b3 |
| main.rs:119:11:119:27 | ...::metadata | semmle.label | ...::metadata |
| main.rs:119:11:119:38 | ...::metadata(...) [Ok] | semmle.label | ...::metadata(...) [Ok] |
| main.rs:119:11:119:47 | ... .unwrap() | semmle.label | ... .unwrap() |
| main.rs:119:11:119:56 | ... .is_dir() | semmle.label | ... .is_dir() |
| main.rs:121:4:121:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:121:36:121:37 | b3 | semmle.label | b3 |
| main.rs:144:6:144:7 | b6 | semmle.label | b6 |
| main.rs:144:39:144:42 | true | semmle.label | true |
| main.rs:146:4:146:34 | danger_accept_invalid_hostnames | semmle.label | danger_accept_invalid_hostnames |
| main.rs:146:36:146:37 | b6 | semmle.label | b6 |
| main.rs:154:17:154:20 | true | semmle.label | true |
subpaths

View File

@@ -0,0 +1,4 @@
query: queries/security/CWE-295/DisabledCertificateCheck.ql
postprocess:
- utils/test/PrettyPrintModels.ql
- utils/test/InlineExpectationsTestQuery.ql

View File

@@ -0,0 +1,157 @@
fn test_native_tls() {
// unsafe
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_certs(true) // $ Alert[rust/disabled-certificate-check]
.build()
.unwrap();
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_hostnames(true) // $ Alert[rust/disabled-certificate-check]
.build()
.unwrap();
let _client = native_tls::TlsConnector::builder()
.min_protocol_version(Some(native_tls::Protocol::Tlsv12))
.use_sni(true)
.danger_accept_invalid_certs(true) // $ Alert[rust/disabled-certificate-check]
.danger_accept_invalid_hostnames(true) // $ Alert[rust/disabled-certificate-check]
.build()
.unwrap();
// safe
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_certs(false) // good
.danger_accept_invalid_hostnames(false) // good
.build()
.unwrap();
// default (safe)
let _client = native_tls::TlsConnector::builder()
.build()
.unwrap();
}
fn test_reqwest() {
// unsafe
let _client = reqwest::Client::builder()
.danger_accept_invalid_certs(true) // $ Alert[rust/disabled-certificate-check]
.build()
.unwrap();
let _client = reqwest::blocking::ClientBuilder::new()
.danger_accept_invalid_hostnames(true) // $ Alert[rust/disabled-certificate-check]
.build()
.unwrap();
let _client = reqwest::ClientBuilder::new()
.danger_accept_invalid_certs(true) // $ Alert[rust/disabled-certificate-check]
.danger_accept_invalid_hostnames(true) // $ Alert[rust/disabled-certificate-check]
.build()
.unwrap();
let _client = reqwest::blocking::Client::builder()
.tcp_keepalive(std::time::Duration::from_secs(30))
.https_only(true)
.danger_accept_invalid_certs(true) // $ Alert[rust/disabled-certificate-check]
.danger_accept_invalid_hostnames(true) // $ Alert[rust/disabled-certificate-check]
.build()
.unwrap();
// safe
let _client = reqwest::blocking::Client::builder()
.danger_accept_invalid_certs(false) // good
.danger_accept_invalid_hostnames(false) // good
.build()
.unwrap();
// default (safe)
let _client = reqwest::blocking::Client::builder()
.build()
.unwrap();
}
fn test_data_flow(sometimes_global: bool) {
let always = true; // $ Source=always
let mut sometimes = true; // $ Source=sometimes
let never = false;
if rand::random_range(0 .. 2) == 0 {
sometimes = false;
}
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_certs(always) // $ Alert[rust/disabled-certificate-check]=always
.build()
.unwrap();
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_certs(sometimes) // $ Alert[rust/disabled-certificate-check]=sometimes
.build()
.unwrap();
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_certs(sometimes_global) // $ Alert[rust/disabled-certificate-check]=arg
.build()
.unwrap();
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_certs(never) // good
.build()
.unwrap();
}
fn test_threat_model_source() {
// hostname setting from `fs` functions returning `bool` directly
// (these are highly unnatural but serve to create simple tests)
let b1: bool = std::fs::exists("main.rs").unwrap(); // $ Source=exists
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_hostnames(b1) // $ Alert[rust/disabled-certificate-check]=exists
.build()
.unwrap();
let b2 = std::path::Path::new("main.rs").metadata().unwrap().is_file(); // $ Source=is_file
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_hostnames(b2) // $ Alert[rust/disabled-certificate-check]=is_file
.build()
.unwrap();
let b3 = std::fs::metadata("main.rs").unwrap().is_dir(); // $ Source=is_dir
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_hostnames(b3) // $ Alert[rust/disabled-certificate-check]=is_dir
.build()
.unwrap();
// hostname setting from `stdin`, parsed to `bool`
// (these are a little closer to something real)
let mut input_line = String::new();
let input = std::io::stdin();
input.read_line(&mut input_line).unwrap();
let b4: bool = input_line.parse::<bool>().unwrap_or(false);
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_hostnames(b4) // $ MISSING: Alert[rust/disabled-certificate-check]=stdin
.build()
.unwrap();
let b5 = std::str::FromStr::from_str(&input_line).unwrap_or(false);
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_hostnames(b5) // $ MISSING: Alert[rust/disabled-certificate-check]=stdin
.build()
.unwrap();
let b6 = if (input_line == "true") { true } else { false }; // $ Source=true
let _client = native_tls::TlsConnector::builder()
.danger_accept_invalid_hostnames(b6) // $ Alert[rust/disabled-certificate-check]=true
.build()
.unwrap();
}
fn main() {
test_native_tls();
test_reqwest();
test_data_flow(true); // $ Source=arg
test_data_flow(false);
test_threat_model_source();
}

View File

@@ -0,0 +1,5 @@
qltest_cargo_check: true
qltest_dependencies:
- reqwest = { version = "0.12.9", features = ["blocking"] }
- native-tls = { version = "0.2.14" }
- rand = { version = "0.9.2" }

View File

@@ -24,27 +24,27 @@
| lifetime.rs:808:23:808:25 | ptr | lifetime.rs:798:9:798:12 | &val | lifetime.rs:808:23:808:25 | ptr | Access of a pointer to $@ after its lifetime has ended. | lifetime.rs:796:6:796:8 | val | val |
| main.rs:64:23:64:24 | p2 | main.rs:44:26:44:28 | &b2 | main.rs:64:23:64:24 | p2 | Access of a pointer to $@ after its lifetime has ended. | main.rs:43:13:43:14 | b2 | b2 |
edges
| deallocation.rs:148:6:148:7 | p1 | deallocation.rs:151:14:151:15 | p1 | provenance | |
| deallocation.rs:148:6:148:7 | p1 | deallocation.rs:158:14:158:15 | p1 | provenance | |
| deallocation.rs:148:30:148:38 | &raw const my_buffer | deallocation.rs:148:6:148:7 | p1 | provenance | |
| deallocation.rs:228:28:228:43 | ...: ... | deallocation.rs:230:18:230:20 | ptr | provenance | |
| deallocation.rs:240:27:240:42 | ...: ... | deallocation.rs:248:18:248:20 | ptr | provenance | |
| deallocation.rs:257:7:257:10 | ptr1 | deallocation.rs:260:4:260:7 | ptr1 | provenance | |
| deallocation.rs:257:7:257:10 | ptr1 | deallocation.rs:260:4:260:7 | ptr1 | provenance | |
| deallocation.rs:257:14:257:33 | &raw mut ... | deallocation.rs:257:7:257:10 | ptr1 | provenance | |
| deallocation.rs:258:7:258:10 | ptr2 | deallocation.rs:261:4:261:7 | ptr2 | provenance | |
| deallocation.rs:258:7:258:10 | ptr2 | deallocation.rs:261:4:261:7 | ptr2 | provenance | |
| deallocation.rs:258:14:258:33 | &raw mut ... | deallocation.rs:258:7:258:10 | ptr2 | provenance | |
| deallocation.rs:260:4:260:7 | ptr1 | deallocation.rs:263:27:263:30 | ptr1 | provenance | |
| deallocation.rs:261:4:261:7 | ptr2 | deallocation.rs:265:26:265:29 | ptr2 | provenance | |
| deallocation.rs:263:27:263:30 | ptr1 | deallocation.rs:228:28:228:43 | ...: ... | provenance | |
| deallocation.rs:265:26:265:29 | ptr2 | deallocation.rs:240:27:240:42 | ...: ... | provenance | |
| deallocation.rs:276:6:276:9 | ptr1 | deallocation.rs:279:13:279:16 | ptr1 | provenance | |
| deallocation.rs:276:6:276:9 | ptr1 | deallocation.rs:287:13:287:16 | ptr1 | provenance | |
| deallocation.rs:276:13:276:28 | &raw mut ... | deallocation.rs:276:6:276:9 | ptr1 | provenance | |
| deallocation.rs:295:6:295:9 | ptr2 | deallocation.rs:298:13:298:16 | ptr2 | provenance | |
| deallocation.rs:295:6:295:9 | ptr2 | deallocation.rs:308:13:308:16 | ptr2 | provenance | |
| deallocation.rs:295:13:295:28 | &raw mut ... | deallocation.rs:295:6:295:9 | ptr2 | provenance | |
| deallocation.rs:242:6:242:7 | p1 | deallocation.rs:245:14:245:15 | p1 | provenance | |
| deallocation.rs:242:6:242:7 | p1 | deallocation.rs:252:14:252:15 | p1 | provenance | |
| deallocation.rs:242:30:242:38 | &raw const my_buffer | deallocation.rs:242:6:242:7 | p1 | provenance | |
| deallocation.rs:322:28:322:43 | ...: ... | deallocation.rs:324:18:324:20 | ptr | provenance | |
| deallocation.rs:334:27:334:42 | ...: ... | deallocation.rs:342:18:342:20 | ptr | provenance | |
| deallocation.rs:351:7:351:10 | ptr1 | deallocation.rs:354:4:354:7 | ptr1 | provenance | |
| deallocation.rs:351:7:351:10 | ptr1 | deallocation.rs:354:4:354:7 | ptr1 | provenance | |
| deallocation.rs:351:14:351:33 | &raw mut ... | deallocation.rs:351:7:351:10 | ptr1 | provenance | |
| deallocation.rs:352:7:352:10 | ptr2 | deallocation.rs:355:4:355:7 | ptr2 | provenance | |
| deallocation.rs:352:7:352:10 | ptr2 | deallocation.rs:355:4:355:7 | ptr2 | provenance | |
| deallocation.rs:352:14:352:33 | &raw mut ... | deallocation.rs:352:7:352:10 | ptr2 | provenance | |
| deallocation.rs:354:4:354:7 | ptr1 | deallocation.rs:357:27:357:30 | ptr1 | provenance | |
| deallocation.rs:355:4:355:7 | ptr2 | deallocation.rs:359:26:359:29 | ptr2 | provenance | |
| deallocation.rs:357:27:357:30 | ptr1 | deallocation.rs:322:28:322:43 | ...: ... | provenance | |
| deallocation.rs:359:26:359:29 | ptr2 | deallocation.rs:334:27:334:42 | ...: ... | provenance | |
| deallocation.rs:370:6:370:9 | ptr1 | deallocation.rs:373:13:373:16 | ptr1 | provenance | |
| deallocation.rs:370:6:370:9 | ptr1 | deallocation.rs:381:13:381:16 | ptr1 | provenance | |
| deallocation.rs:370:13:370:28 | &raw mut ... | deallocation.rs:370:6:370:9 | ptr1 | provenance | |
| deallocation.rs:389:6:389:9 | ptr2 | deallocation.rs:392:13:392:16 | ptr2 | provenance | |
| deallocation.rs:389:6:389:9 | ptr2 | deallocation.rs:402:13:402:16 | ptr2 | provenance | |
| deallocation.rs:389:13:389:28 | &raw mut ... | deallocation.rs:389:6:389:9 | ptr2 | provenance | |
| lifetime.rs:21:2:21:18 | return ... | lifetime.rs:54:11:54:30 | get_local_dangling(...) | provenance | |
| lifetime.rs:21:9:21:18 | &my_local1 | lifetime.rs:21:2:21:18 | return ... | provenance | |
| lifetime.rs:27:2:27:22 | return ... | lifetime.rs:55:11:55:34 | get_local_dangling_mut(...) | provenance | |
@@ -212,32 +212,32 @@ models
| 4 | Summary: <alloc::boxed::Box>::as_ptr; Argument[0].Reference.Reference; ReturnValue.Reference; value |
| 5 | Summary: core::ptr::from_ref; Argument[0]; ReturnValue; value |
nodes
| deallocation.rs:148:6:148:7 | p1 | semmle.label | p1 |
| deallocation.rs:148:30:148:38 | &raw const my_buffer | semmle.label | &raw const my_buffer |
| deallocation.rs:151:14:151:15 | p1 | semmle.label | p1 |
| deallocation.rs:158:14:158:15 | p1 | semmle.label | p1 |
| deallocation.rs:228:28:228:43 | ...: ... | semmle.label | ...: ... |
| deallocation.rs:230:18:230:20 | ptr | semmle.label | ptr |
| deallocation.rs:240:27:240:42 | ...: ... | semmle.label | ...: ... |
| deallocation.rs:248:18:248:20 | ptr | semmle.label | ptr |
| deallocation.rs:257:7:257:10 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:257:14:257:33 | &raw mut ... | semmle.label | &raw mut ... |
| deallocation.rs:258:7:258:10 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:258:14:258:33 | &raw mut ... | semmle.label | &raw mut ... |
| deallocation.rs:260:4:260:7 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:260:4:260:7 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:261:4:261:7 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:261:4:261:7 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:263:27:263:30 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:265:26:265:29 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:276:6:276:9 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:276:13:276:28 | &raw mut ... | semmle.label | &raw mut ... |
| deallocation.rs:279:13:279:16 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:287:13:287:16 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:295:6:295:9 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:295:13:295:28 | &raw mut ... | semmle.label | &raw mut ... |
| deallocation.rs:298:13:298:16 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:308:13:308:16 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:242:6:242:7 | p1 | semmle.label | p1 |
| deallocation.rs:242:30:242:38 | &raw const my_buffer | semmle.label | &raw const my_buffer |
| deallocation.rs:245:14:245:15 | p1 | semmle.label | p1 |
| deallocation.rs:252:14:252:15 | p1 | semmle.label | p1 |
| deallocation.rs:322:28:322:43 | ...: ... | semmle.label | ...: ... |
| deallocation.rs:324:18:324:20 | ptr | semmle.label | ptr |
| deallocation.rs:334:27:334:42 | ...: ... | semmle.label | ...: ... |
| deallocation.rs:342:18:342:20 | ptr | semmle.label | ptr |
| deallocation.rs:351:7:351:10 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:351:14:351:33 | &raw mut ... | semmle.label | &raw mut ... |
| deallocation.rs:352:7:352:10 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:352:14:352:33 | &raw mut ... | semmle.label | &raw mut ... |
| deallocation.rs:354:4:354:7 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:354:4:354:7 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:355:4:355:7 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:355:4:355:7 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:357:27:357:30 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:359:26:359:29 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:370:6:370:9 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:370:13:370:28 | &raw mut ... | semmle.label | &raw mut ... |
| deallocation.rs:373:13:373:16 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:381:13:381:16 | ptr1 | semmle.label | ptr1 |
| deallocation.rs:389:6:389:9 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:389:13:389:28 | &raw mut ... | semmle.label | &raw mut ... |
| deallocation.rs:392:13:392:16 | ptr2 | semmle.label | ptr2 |
| deallocation.rs:402:13:402:16 | ptr2 | semmle.label | ptr2 |
| lifetime.rs:21:2:21:18 | return ... | semmle.label | return ... |
| lifetime.rs:21:9:21:18 | &my_local1 | semmle.label | &my_local1 |
| lifetime.rs:27:2:27:22 | return ... | semmle.label | return ... |

View File

@@ -13,10 +13,23 @@
| deallocation.rs:130:14:130:15 | p1 | deallocation.rs:123:23:123:40 | ...::dangling | deallocation.rs:130:14:130:15 | p1 | This operation dereferences a pointer that may be $@. | deallocation.rs:123:23:123:40 | ...::dangling | invalid |
| deallocation.rs:131:14:131:15 | p2 | deallocation.rs:124:21:124:42 | ...::dangling_mut | deallocation.rs:131:14:131:15 | p2 | This operation dereferences a pointer that may be $@. | deallocation.rs:124:21:124:42 | ...::dangling_mut | invalid |
| deallocation.rs:132:14:132:15 | p3 | deallocation.rs:125:23:125:36 | ...::null | deallocation.rs:132:14:132:15 | p3 | This operation dereferences a pointer that may be $@. | deallocation.rs:125:23:125:36 | ...::null | invalid |
| deallocation.rs:180:15:180:16 | p1 | deallocation.rs:176:3:176:25 | ...::drop_in_place | deallocation.rs:180:15:180:16 | p1 | This operation dereferences a pointer that may be $@. | deallocation.rs:176:3:176:25 | ...::drop_in_place | invalid |
| deallocation.rs:180:15:180:16 | p1 | deallocation.rs:176:3:176:25 | ...::drop_in_place | deallocation.rs:180:15:180:16 | p1 | This operation dereferences a pointer that may be $@. | deallocation.rs:176:3:176:25 | ...::drop_in_place | invalid |
| deallocation.rs:248:18:248:20 | ptr | deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:248:18:248:20 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:242:3:242:25 | ...::drop_in_place | invalid |
| deallocation.rs:248:18:248:20 | ptr | deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:248:18:248:20 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:242:3:242:25 | ...::drop_in_place | invalid |
| deallocation.rs:163:13:163:15 | ptr | deallocation.rs:159:9:159:26 | ...::null_mut | deallocation.rs:163:13:163:15 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:159:9:159:26 | ...::null_mut | invalid |
| deallocation.rs:166:13:166:15 | ptr | deallocation.rs:159:9:159:26 | ...::null_mut | deallocation.rs:166:13:166:15 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:159:9:159:26 | ...::null_mut | invalid |
| deallocation.rs:175:13:175:15 | ptr | deallocation.rs:171:9:171:26 | ...::null_mut | deallocation.rs:175:13:175:15 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:171:9:171:26 | ...::null_mut | invalid |
| deallocation.rs:178:13:178:15 | ptr | deallocation.rs:171:9:171:26 | ...::null_mut | deallocation.rs:178:13:178:15 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:171:9:171:26 | ...::null_mut | invalid |
| deallocation.rs:186:24:186:26 | ptr | deallocation.rs:183:9:183:26 | ...::null_mut | deallocation.rs:186:24:186:26 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:183:9:183:26 | ...::null_mut | invalid |
| deallocation.rs:190:24:190:26 | ptr | deallocation.rs:183:9:183:26 | ...::null_mut | deallocation.rs:190:24:190:26 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:183:9:183:26 | ...::null_mut | invalid |
| deallocation.rs:194:25:194:27 | ptr | deallocation.rs:183:9:183:26 | ...::null_mut | deallocation.rs:194:25:194:27 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:183:9:183:26 | ...::null_mut | invalid |
| deallocation.rs:202:24:202:26 | ptr | deallocation.rs:183:9:183:26 | ...::null_mut | deallocation.rs:202:24:202:26 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:183:9:183:26 | ...::null_mut | invalid |
| deallocation.rs:202:24:202:26 | ptr | deallocation.rs:199:9:199:26 | ...::null_mut | deallocation.rs:202:24:202:26 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:199:9:199:26 | ...::null_mut | invalid |
| deallocation.rs:210:7:210:9 | ptr | deallocation.rs:183:9:183:26 | ...::null_mut | deallocation.rs:210:7:210:9 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:183:9:183:26 | ...::null_mut | invalid |
| deallocation.rs:210:7:210:9 | ptr | deallocation.rs:199:9:199:26 | ...::null_mut | deallocation.rs:210:7:210:9 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:199:9:199:26 | ...::null_mut | invalid |
| deallocation.rs:210:7:210:9 | ptr | deallocation.rs:207:9:207:26 | ...::null_mut | deallocation.rs:210:7:210:9 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:207:9:207:26 | ...::null_mut | invalid |
| deallocation.rs:226:13:226:21 | const_ptr | deallocation.rs:219:15:219:32 | ...::null_mut | deallocation.rs:226:13:226:21 | const_ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:219:15:219:32 | ...::null_mut | invalid |
| deallocation.rs:274:15:274:16 | p1 | deallocation.rs:270:3:270:25 | ...::drop_in_place | deallocation.rs:274:15:274:16 | p1 | This operation dereferences a pointer that may be $@. | deallocation.rs:270:3:270:25 | ...::drop_in_place | invalid |
| deallocation.rs:274:15:274:16 | p1 | deallocation.rs:270:3:270:25 | ...::drop_in_place | deallocation.rs:274:15:274:16 | p1 | This operation dereferences a pointer that may be $@. | deallocation.rs:270:3:270:25 | ...::drop_in_place | invalid |
| deallocation.rs:342:18:342:20 | ptr | deallocation.rs:336:3:336:25 | ...::drop_in_place | deallocation.rs:342:18:342:20 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:336:3:336:25 | ...::drop_in_place | invalid |
| deallocation.rs:342:18:342:20 | ptr | deallocation.rs:336:3:336:25 | ...::drop_in_place | deallocation.rs:342:18:342:20 | ptr | This operation dereferences a pointer that may be $@. | deallocation.rs:336:3:336:25 | ...::drop_in_place | invalid |
edges
| deallocation.rs:20:3:20:21 | ...::dealloc | deallocation.rs:20:23:20:24 | [post] m1 | provenance | Src:MaD:3 MaD:3 |
| deallocation.rs:20:23:20:24 | [post] m1 | deallocation.rs:26:15:26:16 | m1 | provenance | |
@@ -32,7 +45,7 @@ edges
| deallocation.rs:70:23:70:35 | [post] m2 as ... | deallocation.rs:90:7:90:8 | m2 | provenance | |
| deallocation.rs:70:23:70:35 | [post] m2 as ... | deallocation.rs:95:33:95:34 | m2 | provenance | |
| deallocation.rs:95:33:95:34 | m2 | deallocation.rs:95:5:95:31 | ...::write::<...> | provenance | MaD:2 Sink:MaD:2 |
| deallocation.rs:112:3:112:12 | ...::free | deallocation.rs:112:14:112:40 | [post] my_ptr as ... | provenance | Src:MaD:8 MaD:8 |
| deallocation.rs:112:3:112:12 | ...::free | deallocation.rs:112:14:112:40 | [post] my_ptr as ... | provenance | Src:MaD:9 MaD:9 |
| deallocation.rs:112:14:112:40 | [post] my_ptr as ... | deallocation.rs:115:13:115:18 | my_ptr | provenance | |
| deallocation.rs:123:6:123:7 | p1 | deallocation.rs:130:14:130:15 | p1 | provenance | |
| deallocation.rs:123:23:123:40 | ...::dangling | deallocation.rs:123:23:123:42 | ...::dangling(...) | provenance | Src:MaD:4 MaD:4 |
@@ -44,12 +57,37 @@ edges
| deallocation.rs:125:6:125:7 | p3 | deallocation.rs:132:14:132:15 | p3 | provenance | |
| deallocation.rs:125:23:125:36 | ...::null | deallocation.rs:125:23:125:38 | ...::null(...) | provenance | Src:MaD:7 MaD:7 |
| deallocation.rs:125:23:125:38 | ...::null(...) | deallocation.rs:125:6:125:7 | p3 | provenance | |
| deallocation.rs:176:3:176:25 | ...::drop_in_place | deallocation.rs:176:27:176:28 | [post] p1 | provenance | Src:MaD:6 MaD:6 |
| deallocation.rs:176:3:176:25 | ...::drop_in_place | deallocation.rs:176:27:176:28 | [post] p1 | provenance | Src:MaD:6 MaD:6 |
| deallocation.rs:176:27:176:28 | [post] p1 | deallocation.rs:180:15:180:16 | p1 | provenance | |
| deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:242:27:242:29 | [post] ptr | provenance | Src:MaD:6 MaD:6 |
| deallocation.rs:242:3:242:25 | ...::drop_in_place | deallocation.rs:242:27:242:29 | [post] ptr | provenance | Src:MaD:6 MaD:6 |
| deallocation.rs:242:27:242:29 | [post] ptr | deallocation.rs:248:18:248:20 | ptr | provenance | |
| deallocation.rs:159:3:159:5 | ptr | deallocation.rs:163:13:163:15 | ptr | provenance | |
| deallocation.rs:159:3:159:5 | ptr | deallocation.rs:166:13:166:15 | ptr | provenance | |
| deallocation.rs:159:9:159:26 | ...::null_mut | deallocation.rs:159:9:159:28 | ...::null_mut(...) | provenance | Src:MaD:8 MaD:8 |
| deallocation.rs:159:9:159:28 | ...::null_mut(...) | deallocation.rs:159:3:159:5 | ptr | provenance | |
| deallocation.rs:171:3:171:5 | ptr | deallocation.rs:175:13:175:15 | ptr | provenance | |
| deallocation.rs:171:3:171:5 | ptr | deallocation.rs:178:13:178:15 | ptr | provenance | |
| deallocation.rs:171:9:171:26 | ...::null_mut | deallocation.rs:171:9:171:28 | ...::null_mut(...) | provenance | Src:MaD:8 MaD:8 |
| deallocation.rs:171:9:171:28 | ...::null_mut(...) | deallocation.rs:171:3:171:5 | ptr | provenance | |
| deallocation.rs:183:3:183:5 | ptr | deallocation.rs:186:24:186:26 | ptr | provenance | |
| deallocation.rs:183:3:183:5 | ptr | deallocation.rs:190:24:190:26 | ptr | provenance | |
| deallocation.rs:183:3:183:5 | ptr | deallocation.rs:194:25:194:27 | ptr | provenance | |
| deallocation.rs:183:3:183:5 | ptr | deallocation.rs:202:24:202:26 | ptr | provenance | |
| deallocation.rs:183:3:183:5 | ptr | deallocation.rs:210:7:210:9 | ptr | provenance | |
| deallocation.rs:183:9:183:26 | ...::null_mut | deallocation.rs:183:9:183:28 | ...::null_mut(...) | provenance | Src:MaD:8 MaD:8 |
| deallocation.rs:183:9:183:28 | ...::null_mut(...) | deallocation.rs:183:3:183:5 | ptr | provenance | |
| deallocation.rs:199:3:199:5 | ptr | deallocation.rs:202:24:202:26 | ptr | provenance | |
| deallocation.rs:199:3:199:5 | ptr | deallocation.rs:210:7:210:9 | ptr | provenance | |
| deallocation.rs:199:9:199:26 | ...::null_mut | deallocation.rs:199:9:199:28 | ...::null_mut(...) | provenance | Src:MaD:8 MaD:8 |
| deallocation.rs:199:9:199:28 | ...::null_mut(...) | deallocation.rs:199:3:199:5 | ptr | provenance | |
| deallocation.rs:207:3:207:5 | ptr | deallocation.rs:210:7:210:9 | ptr | provenance | |
| deallocation.rs:207:9:207:26 | ...::null_mut | deallocation.rs:207:9:207:28 | ...::null_mut(...) | provenance | Src:MaD:8 MaD:8 |
| deallocation.rs:207:9:207:28 | ...::null_mut(...) | deallocation.rs:207:3:207:5 | ptr | provenance | |
| deallocation.rs:219:3:219:11 | const_ptr | deallocation.rs:226:13:226:21 | const_ptr | provenance | |
| deallocation.rs:219:15:219:32 | ...::null_mut | deallocation.rs:219:15:219:34 | ...::null_mut(...) | provenance | Src:MaD:8 MaD:8 |
| deallocation.rs:219:15:219:34 | ...::null_mut(...) | deallocation.rs:219:3:219:11 | const_ptr | provenance | |
| deallocation.rs:270:3:270:25 | ...::drop_in_place | deallocation.rs:270:27:270:28 | [post] p1 | provenance | Src:MaD:6 MaD:6 |
| deallocation.rs:270:3:270:25 | ...::drop_in_place | deallocation.rs:270:27:270:28 | [post] p1 | provenance | Src:MaD:6 MaD:6 |
| deallocation.rs:270:27:270:28 | [post] p1 | deallocation.rs:274:15:274:16 | p1 | provenance | |
| deallocation.rs:336:3:336:25 | ...::drop_in_place | deallocation.rs:336:27:336:29 | [post] ptr | provenance | Src:MaD:6 MaD:6 |
| deallocation.rs:336:3:336:25 | ...::drop_in_place | deallocation.rs:336:27:336:29 | [post] ptr | provenance | Src:MaD:6 MaD:6 |
| deallocation.rs:336:27:336:29 | [post] ptr | deallocation.rs:342:18:342:20 | ptr | provenance | |
models
| 1 | Sink: core::ptr::read; Argument[0]; pointer-access |
| 2 | Sink: core::ptr::write; Argument[0]; pointer-access |
@@ -58,7 +96,8 @@ models
| 5 | Source: core::ptr::dangling_mut; ReturnValue; pointer-invalidate |
| 6 | Source: core::ptr::drop_in_place; Argument[0]; pointer-invalidate |
| 7 | Source: core::ptr::null; ReturnValue; pointer-invalidate |
| 8 | Source: libc::unix::free; Argument[0]; pointer-invalidate |
| 8 | Source: core::ptr::null_mut; ReturnValue; pointer-invalidate |
| 9 | Source: libc::unix::free; Argument[0]; pointer-invalidate |
nodes
| deallocation.rs:20:3:20:21 | ...::dealloc | semmle.label | ...::dealloc |
| deallocation.rs:20:23:20:24 | [post] m1 | semmle.label | [post] m1 |
@@ -92,12 +131,40 @@ nodes
| deallocation.rs:130:14:130:15 | p1 | semmle.label | p1 |
| deallocation.rs:131:14:131:15 | p2 | semmle.label | p2 |
| deallocation.rs:132:14:132:15 | p3 | semmle.label | p3 |
| deallocation.rs:176:3:176:25 | ...::drop_in_place | semmle.label | ...::drop_in_place |
| deallocation.rs:176:3:176:25 | ...::drop_in_place | semmle.label | ...::drop_in_place |
| deallocation.rs:176:27:176:28 | [post] p1 | semmle.label | [post] p1 |
| deallocation.rs:180:15:180:16 | p1 | semmle.label | p1 |
| deallocation.rs:242:3:242:25 | ...::drop_in_place | semmle.label | ...::drop_in_place |
| deallocation.rs:242:3:242:25 | ...::drop_in_place | semmle.label | ...::drop_in_place |
| deallocation.rs:242:27:242:29 | [post] ptr | semmle.label | [post] ptr |
| deallocation.rs:248:18:248:20 | ptr | semmle.label | ptr |
| deallocation.rs:159:3:159:5 | ptr | semmle.label | ptr |
| deallocation.rs:159:9:159:26 | ...::null_mut | semmle.label | ...::null_mut |
| deallocation.rs:159:9:159:28 | ...::null_mut(...) | semmle.label | ...::null_mut(...) |
| deallocation.rs:163:13:163:15 | ptr | semmle.label | ptr |
| deallocation.rs:166:13:166:15 | ptr | semmle.label | ptr |
| deallocation.rs:171:3:171:5 | ptr | semmle.label | ptr |
| deallocation.rs:171:9:171:26 | ...::null_mut | semmle.label | ...::null_mut |
| deallocation.rs:171:9:171:28 | ...::null_mut(...) | semmle.label | ...::null_mut(...) |
| deallocation.rs:175:13:175:15 | ptr | semmle.label | ptr |
| deallocation.rs:178:13:178:15 | ptr | semmle.label | ptr |
| deallocation.rs:183:3:183:5 | ptr | semmle.label | ptr |
| deallocation.rs:183:9:183:26 | ...::null_mut | semmle.label | ...::null_mut |
| deallocation.rs:183:9:183:28 | ...::null_mut(...) | semmle.label | ...::null_mut(...) |
| deallocation.rs:186:24:186:26 | ptr | semmle.label | ptr |
| deallocation.rs:190:24:190:26 | ptr | semmle.label | ptr |
| deallocation.rs:194:25:194:27 | ptr | semmle.label | ptr |
| deallocation.rs:199:3:199:5 | ptr | semmle.label | ptr |
| deallocation.rs:199:9:199:26 | ...::null_mut | semmle.label | ...::null_mut |
| deallocation.rs:199:9:199:28 | ...::null_mut(...) | semmle.label | ...::null_mut(...) |
| deallocation.rs:202:24:202:26 | ptr | semmle.label | ptr |
| deallocation.rs:207:3:207:5 | ptr | semmle.label | ptr |
| deallocation.rs:207:9:207:26 | ...::null_mut | semmle.label | ...::null_mut |
| deallocation.rs:207:9:207:28 | ...::null_mut(...) | semmle.label | ...::null_mut(...) |
| deallocation.rs:210:7:210:9 | ptr | semmle.label | ptr |
| deallocation.rs:219:3:219:11 | const_ptr | semmle.label | const_ptr |
| deallocation.rs:219:15:219:32 | ...::null_mut | semmle.label | ...::null_mut |
| deallocation.rs:219:15:219:34 | ...::null_mut(...) | semmle.label | ...::null_mut(...) |
| deallocation.rs:226:13:226:21 | const_ptr | semmle.label | const_ptr |
| deallocation.rs:270:3:270:25 | ...::drop_in_place | semmle.label | ...::drop_in_place |
| deallocation.rs:270:3:270:25 | ...::drop_in_place | semmle.label | ...::drop_in_place |
| deallocation.rs:270:27:270:28 | [post] p1 | semmle.label | [post] p1 |
| deallocation.rs:274:15:274:16 | p1 | semmle.label | p1 |
| deallocation.rs:336:3:336:25 | ...::drop_in_place | semmle.label | ...::drop_in_place |
| deallocation.rs:336:3:336:25 | ...::drop_in_place | semmle.label | ...::drop_in_place |
| deallocation.rs:336:27:336:29 | [post] ptr | semmle.label | [post] ptr |
| deallocation.rs:342:18:342:20 | ptr | semmle.label | ptr |
subpaths

View File

@@ -1,6 +1,14 @@
multipleCallTargets
| deallocation.rs:260:11:260:29 | ...::from(...) |
| deallocation.rs:261:11:261:29 | ...::from(...) |
| deallocation.rs:162:5:162:17 | ptr.is_null() |
| deallocation.rs:174:7:174:19 | ptr.is_null() |
| deallocation.rs:186:5:186:17 | ptr.is_null() |
| deallocation.rs:190:5:190:17 | ptr.is_null() |
| deallocation.rs:194:6:194:18 | ptr.is_null() |
| deallocation.rs:202:5:202:17 | ptr.is_null() |
| deallocation.rs:210:25:210:37 | ptr.is_null() |
| deallocation.rs:225:5:225:23 | const_ptr.is_null() |
| deallocation.rs:354:11:354:29 | ...::from(...) |
| deallocation.rs:355:11:355:29 | ...::from(...) |
| lifetime.rs:610:13:610:31 | ...::from(...) |
| lifetime.rs:611:13:611:31 | ...::from(...) |
| lifetime.rs:628:13:628:31 | ...::from(...) |

View File

@@ -137,6 +137,100 @@ pub fn test_ptr_invalid(mode: i32) {
}
}
struct MyObject {
value: i64
}
impl MyObject {
fn is_zero(&self) -> bool {
self.value == 0
}
}
pub unsafe fn test_ptr_invalid_conditions(mode: i32) {
let layout = std::alloc::Layout::new::<MyObject>();
// --- mutable pointer ---
let mut ptr = std::alloc::alloc(layout) as *mut MyObject;
(*ptr).value = 0; // good
if mode == 121 { // (causes a panic below)
ptr = std::ptr::null_mut(); // $ Source[rust/access-invalid-pointer]
}
if ptr.is_null() {
let v = (*ptr).value; // $ Alert[rust/access-invalid-pointer]
println!(" cond1 v = {v}");
} else {
let v = (*ptr).value; // $ SPURIOUS: Alert[rust/access-invalid-pointer] good - unreachable with null pointer
println!(" cond2 v = {v}");
}
if mode == 122 { // (causes a panic below)
ptr = std::ptr::null_mut(); // $ Source[rust/access-invalid-pointer]
}
if !(ptr.is_null()) {
let v = (*ptr).value; // $ SPURIOUS: Alert[rust/access-invalid-pointer] good - unreachable with null pointer
println!(" cond3 v = {v}");
} else {
let v = (*ptr).value; // $ Alert[rust/access-invalid-pointer]
println!(" cond4 v = {v}");
}
if mode == 123 { // (causes a panic below)
ptr = std::ptr::null_mut(); // $ Source[rust/access-invalid-pointer]
}
if ptr.is_null() || (*ptr).value == 0 { // $ SPURIOUS: Alert[rust/access-invalid-pointer] good - deref is protected by short-circuiting
println!(" cond5");
}
if ptr.is_null() || (*ptr).is_zero() { // $ SPURIOUS: Alert[rust/access-invalid-pointer] good - deref is protected by short-circuiting
println!(" cond6");
}
if !ptr.is_null() || (*ptr).value == 0 { // $ Alert[rust/access-invalid-pointer]
println!(" cond7");
}
if mode == 124 { // (causes a panic below)
ptr = std::ptr::null_mut(); // $ Source[rust/access-invalid-pointer]
}
if ptr.is_null() && (*ptr).is_zero() { // $ Alert[rust/access-invalid-pointer]
println!(" cond8");
}
if mode == 125 { // (causes a panic below)
ptr = std::ptr::null_mut(); // $ Source[rust/access-invalid-pointer]
}
if (*ptr).is_zero() || ptr.is_null() { // $ Alert[rust/access-invalid-pointer]
println!(" cond9");
}
// --- immutable pointer ---
let const_ptr;
if mode == 126 { // (causes a panic below)
const_ptr = std::ptr::null_mut(); // $ Source[rust/access-invalid-pointer]
} else {
const_ptr = std::alloc::alloc(layout) as *mut MyObject;
(*const_ptr).value = 0; // good
}
if const_ptr.is_null() {
let v = (*const_ptr).value; // $ Alert[rust/access-invalid-pointer]
println!(" cond10 v = {v}");
} else {
let v = (*const_ptr).value; // $ good - unreachable with null pointer
println!(" cond11 v = {v}");
}
}
// --- drop ---
struct MyBuffer {

View File

@@ -126,6 +126,11 @@ fn main() {
println!("test_ptr_invalid:");
test_ptr_invalid(mode);
println!("test_ptr_invalid_conditions:");
unsafe {
test_ptr_invalid_conditions(mode);
}
println!("test_drop:");
test_drop();

View File

@@ -26,8 +26,10 @@ pub struct f64;
struct Slice<TSlice>;
struct Array<TArray, const N: usize>;
struct Ref<TRef>; // todo: add mut variant
struct Ptr<TPtr>; // todo: add mut variant
struct Ref<TRef>;
struct RefMut<TRefMut>;
struct Ptr<TPtr>;
struct PtrMut<TPtrMut>;
// tuples
struct Tuple0;

View File

@@ -580,7 +580,7 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
}
pragma[nomagic]
private predicate satisfiesConcreteTypesFromIndex(
private predicate satisfiesConcreteTypesToIndex(
App app, TypeAbstraction abs, Constraint constraint, int i
) {
exists(Type t, TypePath path |
@@ -588,13 +588,13 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
if t = abs.getATypeParameter() then any() else app.getTypeAt(path) = t
) and
// Recurse unless we are at the first path
if i = 0 then any() else satisfiesConcreteTypesFromIndex(app, abs, constraint, i - 1)
if i = 0 then any() else satisfiesConcreteTypesToIndex(app, abs, constraint, i - 1)
}
/** Holds if all the concrete types in `constraint` also occur in `app`. */
pragma[nomagic]
private predicate satisfiesConcreteTypes(App app, TypeAbstraction abs, Constraint constraint) {
satisfiesConcreteTypesFromIndex(app, abs, constraint,
satisfiesConcreteTypesToIndex(app, abs, constraint,
max(int i | exists(getNthPath(constraint, i))))
}
@@ -622,7 +622,7 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
}
pragma[nomagic]
private predicate typeParametersEqualFromIndexBase(
private predicate typeParametersEqualToIndexBase(
App app, TypeAbstraction abs, Constraint constraint, TypeParameter tp, TypePath path
) {
path = getNthTypeParameterPath(constraint, tp, 0) and
@@ -632,15 +632,15 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
}
pragma[nomagic]
private predicate typeParametersEqualFromIndex(
private predicate typeParametersEqualToIndex(
App app, TypeAbstraction abs, Constraint constraint, TypeParameter tp, Type t, int i
) {
exists(TypePath path |
t = app.getTypeAt(path) and
if i = 0
then typeParametersEqualFromIndexBase(app, abs, constraint, tp, path)
then typeParametersEqualToIndexBase(app, abs, constraint, tp, path)
else (
typeParametersEqualFromIndex(app, abs, constraint, tp, t, i - 1) and
typeParametersEqualToIndex(app, abs, constraint, tp, t, i - 1) and
path = getNthTypeParameterPath(constraint, tp, i)
)
)
@@ -657,19 +657,19 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
exists(int n | n = max(int i | exists(getNthTypeParameterPath(constraint, tp, i))) |
// If the largest index is 0, then there are no equalities to check as
// the type parameter only occurs once.
if n = 0 then any() else typeParametersEqualFromIndex(app, abs, constraint, tp, _, n)
if n = 0 then any() else typeParametersEqualToIndex(app, abs, constraint, tp, _, n)
)
)
}
private predicate typeParametersHaveEqualInstantiationFromIndex(
private predicate typeParametersHaveEqualInstantiationToIndex(
App app, TypeAbstraction abs, Constraint constraint, int i
) {
exists(TypeParameter tp | tp = getNthTypeParameter(abs, i) |
typeParametersEqual(app, abs, constraint, tp) and
if i = 0
then any()
else typeParametersHaveEqualInstantiationFromIndex(app, abs, constraint, i - 1)
else typeParametersHaveEqualInstantiationToIndex(app, abs, constraint, i - 1)
)
}
@@ -699,7 +699,7 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
not exists(getNthTypeParameter(abs, _))
or
exists(int n | n = max(int i | exists(getNthTypeParameter(abs, i))) |
typeParametersHaveEqualInstantiationFromIndex(app, abs, constraint, n)
typeParametersHaveEqualInstantiationToIndex(app, abs, constraint, n)
)
)
}