Skip to content

Commit e0d9dad

Browse files
authored
Merge branch 'main' into jonjanego/useless-expression-tags
2 parents d8ef4fc + 145c141 commit e0d9dad

File tree

20 files changed

+402
-282
lines changed

20 files changed

+402
-282
lines changed

cpp/ql/test/library-tests/specifiers2/specifiers2.expected

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
| Function | cpp20.cpp:62:8:62:8 | operator= | operator= | extern, inline, is_constexpr, public |
2828
| Function | cpp20.cpp:62:8:62:8 | operator= | operator= | extern, inline, is_constexpr, public |
2929
| Function | cpp20.cpp:64:5:64:21 | TestExplicitBool4 | TestExplicitBool4 | explicit, extern, public |
30-
| Function | file://:0:0:0:0 | TestExplicitBool | TestExplicitBool | explicit, has_trailing_return_type |
30+
| Function | file://:0:0:0:0 | TestExplicitBool | TestExplicitBool | explicit |
3131
| Function | file://:0:0:0:0 | operator delete | operator delete | extern |
3232
| Function | file://:0:0:0:0 | operator new | operator new | extern |
3333
| Function | specifiers2.c:11:6:11:6 | f | f | c_linkage, extern |
@@ -67,6 +67,8 @@
6767
| Function | specifiers2pp.cpp:63:19:63:34 | member_constexpr | member_constexpr | const, declared_constexpr, inline, is_constexpr, private |
6868
| Function | specifiers2pp.cpp:64:19:64:40 | member_const_constexpr | member_const_constexpr | const, declared_constexpr, inline, is_constexpr, private |
6969
| FunctionDeclarationEntry | cpp20.cpp:11:14:11:24 | declaration of TestExplict | TestExplict | explicit |
70+
| FunctionDeclarationEntry | cpp20.cpp:23:1:23:1 | declaration of TestExplicitBool | TestExplicitBool | has_trailing_return_type |
71+
| FunctionDeclarationEntry | cpp20.cpp:24:1:24:16 | definition of TestExplicitBool | TestExplicitBool | has_trailing_return_type |
7072
| FunctionDeclarationEntry | cpp20.cpp:40:23:40:23 | definition of TestExplicitBool2 | TestExplicitBool2 | explicit |
7173
| FunctionDeclarationEntry | cpp20.cpp:51:5:51:5 | definition of TestExplicitBool3 | TestExplicitBool3 | explicit |
7274
| FunctionDeclarationEntry | cpp20.cpp:51:5:51:21 | declaration of TestExplicitBool3 | TestExplicitBool3 | explicit |

csharp/documentation/library-coverage/coverage.csv

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ ILLink.Shared,,,37,,,,,,,,,,,,,,,,,,,11,26
88
ILLink.Tasks,,,5,,,,,,,,,,,,,,,,,,,4,1
99
Internal.IL,,,54,,,,,,,,,,,,,,,,,,,28,26
1010
Internal.Pgo,,,9,,,,,,,,,,,,,,,,,,,2,7
11-
Internal.TypeSystem,,,345,,,,,,,,,,,,,,,,,,,205,140
11+
Internal.TypeSystem,,,342,,,,,,,,,,,,,,,,,,,205,137
1212
Microsoft.ApplicationBlocks.Data,28,,,,,,,,,,,,28,,,,,,,,,,
1313
Microsoft.AspNetCore.Components,2,4,2,,,,,,,2,,,,,,,,,4,,,1,1
1414
Microsoft.AspNetCore.Http,,,1,,,,,,,,,,,,,,,,,,,1,
1515
Microsoft.AspNetCore.Mvc,,,2,,,,,,,,,,,,,,,,,,,,2
1616
Microsoft.AspNetCore.WebUtilities,,,2,,,,,,,,,,,,,,,,,,,2,
1717
Microsoft.CSharp,,,2,,,,,,,,,,,,,,,,,,,2,
18-
Microsoft.Diagnostics.Tools.Pgo,,,23,,,,,,,,,,,,,,,,,,,,23
18+
Microsoft.Diagnostics.Tools.Pgo,,,21,,,,,,,,,,,,,,,,,,,,21
1919
Microsoft.DotNet.Build.Tasks,,,11,,,,,,,,,,,,,,,,,,,9,2
2020
Microsoft.DotNet.PlatformAbstractions,,,1,,,,,,,,,,,,,,,,,,,1,
2121
Microsoft.EntityFrameworkCore,6,,12,,,,,,,,,,6,,,,,,,,,,12
2222
Microsoft.Extensions.Caching.Distributed,,,3,,,,,,,,,,,,,,,,,,,,3
2323
Microsoft.Extensions.Caching.Memory,,,37,,,,,,,,,,,,,,,,,,,5,32
24-
Microsoft.Extensions.Configuration,,3,123,,,,,,,,,,,,,3,,,,,,40,83
24+
Microsoft.Extensions.Configuration,,3,118,,,,,,,,,,,,,3,,,,,,41,77
2525
Microsoft.Extensions.DependencyInjection,,,209,,,,,,,,,,,,,,,,,,,15,194
2626
Microsoft.Extensions.DependencyModel,,1,57,,,,,,,,,,,,,1,,,,,,13,44
2727
Microsoft.Extensions.Diagnostics.Metrics,,,14,,,,,,,,,,,,,,,,,,,1,13
@@ -31,16 +31,16 @@ Microsoft.Extensions.Hosting,,,61,,,,,,,,,,,,,,,,,,,29,32
3131
Microsoft.Extensions.Http,,,9,,,,,,,,,,,,,,,,,,,7,2
3232
Microsoft.Extensions.Logging,,,107,,,,,,,,,,,,,,,,,,,26,81
3333
Microsoft.Extensions.Options,,,174,,,,,,,,,,,,,,,,,,,48,126
34-
Microsoft.Extensions.Primitives,,,76,,,,,,,,,,,,,,,,,,,67,9
34+
Microsoft.Extensions.Primitives,,,75,,,,,,,,,,,,,,,,,,,68,7
3535
Microsoft.Interop,,,216,,,,,,,,,,,,,,,,,,,71,145
3636
Microsoft.JSInterop,2,,,,,,,,,,2,,,,,,,,,,,,
3737
Microsoft.NET.Build.Tasks,,,5,,,,,,,,,,,,,,,,,,,3,2
38-
Microsoft.VisualBasic,,,13,,,,,,,,,,,,,,,,,,,1,12
38+
Microsoft.VisualBasic,,,6,,,,,,,,,,,,,,,,,,,1,5
3939
Microsoft.Win32,,4,2,,,,,,,,,,,,,,,,,,4,,2
40-
Mono.Linker,,,280,,,,,,,,,,,,,,,,,,,129,151
40+
Mono.Linker,,,278,,,,,,,,,,,,,,,,,,,130,148
4141
MySql.Data.MySqlClient,48,,,,,,,,,,,,48,,,,,,,,,,
4242
Newtonsoft.Json,,,91,,,,,,,,,,,,,,,,,,,73,18
4343
ServiceStack,194,,7,27,,,,,75,,,,92,,,,,,,,,7,
4444
SourceGenerators,,,5,,,,,,,,,,,,,,,,,,,,5
45-
System,54,47,12255,,6,5,5,,,4,1,,33,2,,6,15,17,4,3,,5955,6300
45+
System,54,47,12111,,6,5,5,,,4,1,,33,2,,6,15,17,4,3,,5993,6118
4646
Windows.Security.Cryptography.Core,1,,,,,,,1,,,,,,,,,,,,,,,

csharp/documentation/library-coverage/coverage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ C# framework & library support
88

99
Framework / library,Package,Flow sources,Taint & value steps,Sinks (total),`CWE-079` :sub:`Cross-site scripting`
1010
`ServiceStack <https://servicestack.net/>`_,"``ServiceStack.*``, ``ServiceStack``",,7,194,
11-
System,"``System.*``, ``System``",47,12255,54,5
12-
Others,"``Amazon.Lambda.APIGatewayEvents``, ``Amazon.Lambda.Core``, ``Dapper``, ``ILCompiler``, ``ILLink.RoslynAnalyzer``, ``ILLink.Shared``, ``ILLink.Tasks``, ``Internal.IL``, ``Internal.Pgo``, ``Internal.TypeSystem``, ``Microsoft.ApplicationBlocks.Data``, ``Microsoft.AspNetCore.Components``, ``Microsoft.AspNetCore.Http``, ``Microsoft.AspNetCore.Mvc``, ``Microsoft.AspNetCore.WebUtilities``, ``Microsoft.CSharp``, ``Microsoft.Diagnostics.Tools.Pgo``, ``Microsoft.DotNet.Build.Tasks``, ``Microsoft.DotNet.PlatformAbstractions``, ``Microsoft.EntityFrameworkCore``, ``Microsoft.Extensions.Caching.Distributed``, ``Microsoft.Extensions.Caching.Memory``, ``Microsoft.Extensions.Configuration``, ``Microsoft.Extensions.DependencyInjection``, ``Microsoft.Extensions.DependencyModel``, ``Microsoft.Extensions.Diagnostics.Metrics``, ``Microsoft.Extensions.FileProviders``, ``Microsoft.Extensions.FileSystemGlobbing``, ``Microsoft.Extensions.Hosting``, ``Microsoft.Extensions.Http``, ``Microsoft.Extensions.Logging``, ``Microsoft.Extensions.Options``, ``Microsoft.Extensions.Primitives``, ``Microsoft.Interop``, ``Microsoft.JSInterop``, ``Microsoft.NET.Build.Tasks``, ``Microsoft.VisualBasic``, ``Microsoft.Win32``, ``Mono.Linker``, ``MySql.Data.MySqlClient``, ``Newtonsoft.Json``, ``SourceGenerators``, ``Windows.Security.Cryptography.Core``",60,2272,152,4
13-
Totals,,107,14534,400,9
11+
System,"``System.*``, ``System``",47,12111,54,5
12+
Others,"``Amazon.Lambda.APIGatewayEvents``, ``Amazon.Lambda.Core``, ``Dapper``, ``ILCompiler``, ``ILLink.RoslynAnalyzer``, ``ILLink.Shared``, ``ILLink.Tasks``, ``Internal.IL``, ``Internal.Pgo``, ``Internal.TypeSystem``, ``Microsoft.ApplicationBlocks.Data``, ``Microsoft.AspNetCore.Components``, ``Microsoft.AspNetCore.Http``, ``Microsoft.AspNetCore.Mvc``, ``Microsoft.AspNetCore.WebUtilities``, ``Microsoft.CSharp``, ``Microsoft.Diagnostics.Tools.Pgo``, ``Microsoft.DotNet.Build.Tasks``, ``Microsoft.DotNet.PlatformAbstractions``, ``Microsoft.EntityFrameworkCore``, ``Microsoft.Extensions.Caching.Distributed``, ``Microsoft.Extensions.Caching.Memory``, ``Microsoft.Extensions.Configuration``, ``Microsoft.Extensions.DependencyInjection``, ``Microsoft.Extensions.DependencyModel``, ``Microsoft.Extensions.Diagnostics.Metrics``, ``Microsoft.Extensions.FileProviders``, ``Microsoft.Extensions.FileSystemGlobbing``, ``Microsoft.Extensions.Hosting``, ``Microsoft.Extensions.Http``, ``Microsoft.Extensions.Logging``, ``Microsoft.Extensions.Options``, ``Microsoft.Extensions.Primitives``, ``Microsoft.Interop``, ``Microsoft.JSInterop``, ``Microsoft.NET.Build.Tasks``, ``Microsoft.VisualBasic``, ``Microsoft.Win32``, ``Mono.Linker``, ``MySql.Data.MySqlClient``, ``Newtonsoft.Json``, ``SourceGenerators``, ``Windows.Security.Cryptography.Core``",60,2252,152,4
13+
Totals,,107,14370,400,9
1414

csharp/ql/lib/semmle/code/csharp/controlflow/internal/PreSsa.qll

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,9 @@ module PreSsa {
175175
}
176176

177177
final AssignableRead getAFirstRead() {
178-
exists(SsaInput::BasicBlock bb1, int i1, SsaInput::BasicBlock bb2, int i2 |
179-
this.definesAt(_, bb1, i1) and
180-
SsaImpl::adjacentDefRead(this, bb1, i1, bb2, i2) and
181-
result = bb2.getElement(i2)
178+
exists(SsaInput::BasicBlock bb, int i |
179+
SsaImpl::firstUse(this, bb, i, true) and
180+
result = bb.getElement(i)
182181
)
183182
}
184183

@@ -216,8 +215,7 @@ module PreSsa {
216215
predicate adjacentReadPairSameVar(AssignableRead read1, AssignableRead read2) {
217216
exists(SsaInput::BasicBlock bb1, int i1, SsaInput::BasicBlock bb2, int i2 |
218217
read1 = bb1.getElement(i1) and
219-
SsaInput::variableRead(bb1, i1, _, true) and
220-
SsaImpl::adjacentDefRead(_, bb1, i1, bb2, i2) and
218+
SsaImpl::adjacentUseUse(bb1, i1, bb2, i2, _, true) and
221219
read2 = bb2.getElement(i2)
222220
)
223221
}

java/ql/integration-tests/java/buildless-snapshot-repository/test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import subprocess
2-
import sys
2+
import runs_on
33

44

55
def test(codeql, java):
66
# This serves the "repo" directory on http://localhost:9427
7+
command = ["python3", "-m", "http.server", "9427", "-b", "localhost"]
8+
if runs_on.github_actions and runs_on.posix:
9+
# On GitHub Actions, we try to run the server with higher priority
10+
command = ["sudo", "nice", "-n", "10"] + command
711
repo_server_process = subprocess.Popen(
8-
[sys.executable, "-m", "http.server", "9427"], cwd="repo"
12+
command, cwd="repo"
913
)
1014
try:
1115
codeql.database.create(
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* All existing modelling and support for `javax.persistence` now applies to `jakarta.persistence` as well.

java/ql/lib/semmle/code/java/deadcode/DeadField.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ class JpaReadField extends ReflectivelyReadField {
161161
this = entity.getAField() and
162162
(
163163
entity.getAccessType() = "field" or
164-
this.hasAnnotation("javax.persistence", "Access")
164+
this.hasAnnotation(getAPersistencePackageName(), "Access")
165165
)
166166
|
167-
not this.hasAnnotation("javax.persistence", "Transient") and
167+
not this.hasAnnotation(getAPersistencePackageName(), "Transient") and
168168
not this.isStatic() and
169169
not this.isFinal()
170170
)

java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import semmle.code.java.deadcode.StrutsEntryPoints
77
import semmle.code.java.deadcode.TestEntryPoints
88
import semmle.code.java.deadcode.WebEntryPoints
99
import semmle.code.java.frameworks.javaee.JavaServerFaces
10+
import semmle.code.java.frameworks.javaee.Persistence
1011
import semmle.code.java.frameworks.JAXB
1112
import semmle.code.java.frameworks.JaxWS
1213
import semmle.code.java.JMX
@@ -395,7 +396,7 @@ class PersistencePropertyMethod extends CallableEntryPoint {
395396
this = e.getACallable() and
396397
(
397398
e.getAccessType() = "property" or
398-
this.hasAnnotation("javax.persistence", "Access")
399+
this.hasAnnotation(getAPersistencePackageName(), "Access")
399400
) and
400401
(
401402
this.getName().matches("get%") or

0 commit comments

Comments
 (0)