Skip to content

Commit 6bfa08c

Browse files
committed
Merge branch 'main' into rdmarsh2/swift/constructor-flow
2 parents 3bf3876 + ce937e7 commit 6bfa08c

File tree

1,229 files changed

+92696
-197555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,229 files changed

+92696
-197555
lines changed

.github/workflows/check-qldoc.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ jobs:
2626
shell: bash
2727
run: |
2828
EXIT_CODE=0
29-
# TODO: remove the swift exception from the regex when we fix generated QLdoc
3029
# TODO: remove the shared exception from the regex when coverage of qlpacks without dbschemes is supported
31-
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!(swift|shared))[a-z]*/ql/lib' || true; } | sort -u)"
30+
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!(shared))[a-z]*/ql/lib' || true; } | sort -u)"
3231
for pack_dir in ${changed_lib_packs}; do
3332
lang="${pack_dir%/ql/lib}"
3433
codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-current.txt" --dir="${pack_dir}"

config/identical-files.json

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,67 @@
11
{
22
"DataFlow Java/C++/C#/Go/Python/Ruby/Swift": [
3+
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlow.qll",
4+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlow.qll",
5+
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlow.qll",
6+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlow.qll",
7+
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlow.qll",
8+
"go/ql/lib/semmle/go/dataflow/internal/DataFlow.qll",
9+
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlow.qll",
10+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlow.qll",
11+
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlow.qll"
12+
],
13+
"DataFlowImpl Java/C++/C#/Go/Python/Ruby/Swift": [
314
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll",
15+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll",
16+
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
17+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
18+
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll",
19+
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl.qll",
20+
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl.qll",
21+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
22+
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl.qll"
23+
],
24+
"DataFlow Java/C++/C#/Go/Python/Ruby/Swift Legacy Configuration": [
25+
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl1.qll",
426
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll",
527
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll",
628
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll",
729
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll",
830
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll",
931
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForSerializability.qll",
1032
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForOnActivityResult.qll",
11-
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll",
33+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl1.qll",
1234
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll",
1335
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll",
1436
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll",
1537
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll",
16-
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
38+
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl1.qll",
1739
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll",
1840
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll",
1941
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll",
20-
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
42+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl1.qll",
2143
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll",
2244
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll",
2345
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll",
24-
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll",
46+
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl1.qll",
2547
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll",
2648
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll",
2749
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll",
2850
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll",
2951
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll",
30-
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl.qll",
52+
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl1.qll",
3153
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl2.qll",
3254
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImplForStringsNewReplacer.qll",
33-
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl.qll",
55+
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl1.qll",
3456
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll",
3557
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",
3658
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll",
3759
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplForRegExp.qll",
38-
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
60+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl1.qll",
3961
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll",
4062
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForHttpClientLibraries.qll",
4163
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForPathname.qll",
42-
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl.qll"
64+
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl1.qll"
4365
],
4466
"DataFlow Java/C++/C#/Go/Python/Ruby/Swift Common": [
4567
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll",
@@ -52,7 +74,18 @@
5274
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll",
5375
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll"
5476
],
55-
"TaintTracking::Configuration Java/C++/C#/Go/Python/Ruby/Swift": [
77+
"TaintTracking Java/C++/C#/Go/Python/Ruby/Swift": [
78+
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking1/TaintTracking.qll",
79+
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTracking.qll",
80+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTracking.qll",
81+
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/tainttracking1/TaintTracking.qll",
82+
"go/ql/lib/semmle/go/dataflow/internal/tainttracking1/TaintTracking.qll",
83+
"java/ql/lib/semmle/code/java/dataflow/internal/tainttracking1/TaintTracking.qll",
84+
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking1/TaintTracking.qll",
85+
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttracking1/TaintTracking.qll",
86+
"swift/ql/lib/codeql/swift/dataflow/internal/tainttracking1/TaintTracking.qll"
87+
],
88+
"TaintTracking Legacy Configuration Java/C++/C#/Go/Python/Ruby/Swift": [
5689
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
5790
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
5891
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",

cpp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Xunit;
22
using Semmle.Autobuild.Shared;
3+
using Semmle.Util;
34
using System.Collections.Generic;
45
using System;
56
using System.Linq;
@@ -75,6 +76,15 @@ int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory,
7576
throw new ArgumentException("Missing RunProcess " + pattern);
7677
}
7778

79+
int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory, IDictionary<string, string>? env, BuildOutputHandler onOutput, BuildOutputHandler onError)
80+
{
81+
var ret = (this as IBuildActions).RunProcess(cmd, args, workingDirectory, env, out var stdout);
82+
83+
stdout.ForEach(line => onOutput(line));
84+
85+
return ret;
86+
}
87+
7888
public IList<string> DirectoryDeleteIn = new List<string>();
7989

8090
void IBuildActions.DirectoryDelete(string dir, bool recursive)
@@ -184,6 +194,15 @@ public void DownloadFile(string address, string fileName)
184194
if (!DownloadFiles.Contains((address, fileName)))
185195
throw new ArgumentException($"Missing DownloadFile, {address}, {fileName}");
186196
}
197+
198+
public IDiagnosticsWriter CreateDiagnosticsWriter(string filename) => new TestDiagnosticWriter();
199+
}
200+
201+
internal class TestDiagnosticWriter : IDiagnosticsWriter
202+
{
203+
public IList<DiagnosticMessage> Diagnostics { get; } = new List<DiagnosticMessage>();
204+
205+
public void AddEntry(DiagnosticMessage message) => this.Diagnostics.Add(message);
187206
}
188207

189208
/// <summary>
@@ -243,6 +262,7 @@ CppAutobuilder CreateAutoBuilder(bool isWindows,
243262
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_TRAP_DIR"] = "";
244263
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_SOURCE_ARCHIVE_DIR"] = "";
245264
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_ROOT"] = $@"C:\codeql\{codeqlUpperLanguage.ToLowerInvariant()}";
265+
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_DIAGNOSTIC_DIR"] = "";
246266
Actions.GetEnvironmentVariable["CODEQL_JAVA_HOME"] = @"C:\codeql\tools\java";
247267
Actions.GetEnvironmentVariable["CODEQL_PLATFORM"] = "win64";
248268
Actions.GetEnvironmentVariable["SEMMLE_DIST"] = @"C:\odasa";

cpp/autobuilder/Semmle.Autobuild.Cpp/CppAutobuilder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Semmle.Autobuild.Shared;
2+
using Semmle.Util;
23

34
namespace Semmle.Autobuild.Cpp
45
{
@@ -21,7 +22,7 @@ public CppAutobuildOptions(IBuildActions actions) : base(actions)
2122

2223
public class CppAutobuilder : Autobuilder<CppAutobuildOptions>
2324
{
24-
public CppAutobuilder(IBuildActions actions, CppAutobuildOptions options) : base(actions, options) { }
25+
public CppAutobuilder(IBuildActions actions, CppAutobuildOptions options) : base(actions, options, new DiagnosticClassifier()) { }
2526

2627
public override BuildScript GetBuildScript()
2728
{
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
category: majorAnalysis
3+
---
4+
* The main data flow and taint tracking APIs have been changed. The old APIs
5+
remain in place for now and translate to the new through a
6+
backwards-compatible wrapper. If multiple configurations are in scope
7+
simultaneously, then this may affect results slightly. The new API is quite
8+
similar to the old, but makes use of a configuration module instead of a
9+
configuration class.

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/DataFlow.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
import cpp
2323

2424
module DataFlow {
25-
import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowImpl
25+
import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlow
26+
import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowImpl1
2627
}

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/TaintTracking.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ import semmle.code.cpp.ir.dataflow.DataFlow
1919
import semmle.code.cpp.ir.dataflow.DataFlow2
2020

2121
module TaintTracking {
22+
import experimental.semmle.code.cpp.ir.dataflow.internal.tainttracking1.TaintTracking
2223
import experimental.semmle.code.cpp.ir.dataflow.internal.tainttracking1.TaintTrackingImpl
2324
}

0 commit comments

Comments
 (0)