Skip to content

Commit bcb3863

Browse files
authored
Merge branch 'main' into redsun82/rust-regenerate-models
2 parents 16b9bec + 29b37a4 commit bcb3863

File tree

36 files changed

+435
-2148
lines changed

36 files changed

+435
-2148
lines changed

java/ql/integration-tests/java/query-suite/java-code-quality-extended.qls.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ql/java/ql/src/Advisory/Declarations/MissingOverrideAnnotation.ql
2-
ql/java/ql/src/Advisory/Deprecated Code/AvoidDeprecatedCallableAccess.ql
32
ql/java/ql/src/Advisory/Documentation/ImpossibleJavadocThrows.ql
43
ql/java/ql/src/Advisory/Documentation/SpuriousJavadocParam.ql
54
ql/java/ql/src/Compatibility/JDK9/JdkInternalAccess.ql

java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ql/java/ql/src/Advisory/Declarations/MissingOverrideAnnotation.ql
2-
ql/java/ql/src/Advisory/Deprecated Code/AvoidDeprecatedCallableAccess.ql
32
ql/java/ql/src/Advisory/Documentation/ImpossibleJavadocThrows.ql
43
ql/java/ql/src/Advisory/Documentation/SpuriousJavadocParam.ql
54
ql/java/ql/src/Compatibility/JDK9/JdkInternalAccess.ql

java/ql/src/Advisory/Deprecated Code/AvoidDeprecatedCallableAccess.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
* @problem.severity recommendation
77
* @precision high
88
* @id java/deprecated-call
9-
* @tags quality
10-
* maintainability
9+
* @tags maintainability
1110
* readability
1211
* non-attributable
1312
* external/cwe/cwe-477

javascript/ql/lib/semmle/javascript/frameworks/Fastify.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* Provides classes for working with [Fastify](https://www.fastify.io/) applications.
2+
* Provides classes for working with [Fastify](https://www.fastify.dev/) applications.
33
*/
44

55
import javascript
66
import semmle.javascript.frameworks.HTTP
77

88
/**
9-
* Provides classes for working with [Fastify](https://www.fastify.io/) applications.
9+
* Provides classes for working with [Fastify](https://www.fastify.dev/) applications.
1010
*/
1111
module Fastify {
1212
/**

rust/ql/consistency-queries/PathResolutionConsistency.ql

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,17 @@ private import codeql.rust.internal.PathResolution
1010
private import codeql.rust.internal.PathResolutionConsistency as PathResolutionConsistency
1111
private import codeql.rust.elements.Locatable
1212
private import codeql.Locations
13-
import PathResolutionConsistency
1413

1514
class SourceLocatable extends Locatable {
16-
Location getLocation() {
17-
if super.getLocation().fromSource()
18-
then result = super.getLocation()
19-
else result instanceof EmptyLocation
20-
}
15+
SourceLocatable() { this.fromSource() }
2116
}
2217

23-
query predicate multipleMethodCallTargets(SourceLocatable a, SourceLocatable b) {
24-
PathResolutionConsistency::multipleMethodCallTargets(a, b)
18+
query predicate multipleCallTargets(SourceLocatable a) {
19+
PathResolutionConsistency::multipleCallTargets(a, _)
2520
}
2621

27-
query predicate multiplePathResolutions(SourceLocatable a, SourceLocatable b) {
28-
PathResolutionConsistency::multiplePathResolutions(a, b)
22+
query predicate multiplePathResolutions(SourceLocatable a) {
23+
PathResolutionConsistency::multiplePathResolutions(a, _)
2924
}
3025

3126
query predicate multipleCanonicalPaths(SourceLocatable i, SourceLocatable c, string path) {

rust/ql/lib/codeql/rust/elements/internal/AstNodeImpl.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ module Impl {
7070
*/
7171
pragma[nomagic]
7272
predicate isFromMacroExpansion() {
73-
exists(MacroCall mc |
74-
MacroCallImpl::isInMacroExpansion(mc, this) and
75-
not this = mc.getATokenTreeNode()
73+
exists(AstNode root |
74+
MacroCallImpl::isInMacroExpansion(root, this) and
75+
not this = root.(MacroCall).getATokenTreeNode()
7676
)
7777
}
7878

rust/ql/lib/codeql/rust/elements/internal/MacroCallImpl.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ module Impl {
1414
private import rust
1515

1616
pragma[nomagic]
17-
predicate isInMacroExpansion(MacroCall mc, AstNode n) {
18-
n = mc.getMacroCallExpansion()
17+
predicate isInMacroExpansion(AstNode root, AstNode n) {
18+
n = root.(MacroCall).getMacroCallExpansion()
1919
or
20-
isInMacroExpansion(mc, n.getParentNode())
20+
n = root.(Adt).getDeriveMacroExpansion(_)
21+
or
22+
isInMacroExpansion(root, n.getParentNode())
2123
}
2224

2325
// the following QLdoc is generated: if you need to edit it, do it in the schema file

rust/ql/lib/codeql/rust/elements/internal/TupleStructPatImpl.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ module Impl {
3434
exists(this.getField(pragma[only_bind_into](pos)))
3535
}
3636

37+
/**
38+
* Gets the struct matched by this pattern.
39+
*/
40+
Struct getStruct() { result = PathResolution::resolvePath(this.getPath()) }
41+
3742
/** Gets the tuple field that matches the `pos`th pattern of this pattern. */
3843
pragma[nomagic]
3944
TupleField getTupleField(int pos) {

rust/ql/lib/codeql/rust/frameworks/Poem.qll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44

55
private import rust
66
private import codeql.rust.Concepts
7-
private import codeql.rust.dataflow.DataFlow
87

98
/**
109
* Parameters of a handler function
1110
*/
1211
private class PoemHandlerParam extends RemoteSource::Range {
1312
PoemHandlerParam() {
1413
exists(TupleStructPat param |
15-
param.getResolvedPath() = ["crate::web::query::Query", "crate::web::path::Path"]
16-
|
17-
this.asPat().getPat() = param.getAField()
14+
this.asPat().getPat() = param.getAField() and
15+
param.getStruct().getCanonicalPath() = ["poem::web::query::Query", "poem::web::path::Path"]
1816
)
1917
}
2018
}

rust/ql/lib/codeql/rust/internal/PathResolution.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ pragma[nomagic]
11321132
private predicate crateDependencyEdge(SourceFileItemNode file, string name, CrateItemNode dep) {
11331133
exists(CrateItemNode c | dep = c.(Crate).getDependency(name) | file = c.getASourceFile())
11341134
or
1135-
// Give builtin files, such as `await.rs`, access to `std`
1135+
// Give builtin files access to `std`
11361136
file instanceof BuiltinSourceFile and
11371137
dep.getName() = name and
11381138
name = "std"
@@ -1501,7 +1501,7 @@ private predicate preludeEdge(SourceFile f, string name, ItemNode i) {
15011501
exists(Crate stdOrCore, ModuleLikeNode mod, ModuleItemNode prelude, ModuleItemNode rust |
15021502
f = any(Crate c0 | stdOrCore = c0.getDependency(_) or stdOrCore = c0).getASourceFile()
15031503
or
1504-
// Give builtin files, such as `await.rs`, access to the prelude
1504+
// Give builtin files access to the prelude
15051505
f instanceof BuiltinSourceFile
15061506
|
15071507
stdOrCore.getName() = ["std", "core"] and

0 commit comments

Comments
 (0)