Skip to content

Commit 9d521e9

Browse files
authored
Merge pull request #20333 from michaelnebel/rust/ql4ql
Rust: Fix some Ql4Ql violations.
2 parents 7ae5d40 + 6f5da52 commit 9d521e9

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ private ExprCfgNode getALastEvalNode(ExprCfgNode e) {
196196

197197
/**
198198
* Holds if a reverse local flow step should be added from the post-update node
199-
* for `e` to the post-update node for the result.
199+
* for `e` to the post-update node for the result. `preservesValue` is true
200+
* if the step is value preserving.
200201
*
201202
* This is needed to allow for side-effects on compound expressions to propagate
202203
* to sub components. For example, in

rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ private import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprB
5151

5252
/**
5353
* Holds if in a call to the function with canonical path `path`, the value referred
54-
* to by `output` is a flow source of the given `kind`.
54+
* to by `output` is a flow source of the given `kind` and `madId` is the data
55+
* extension row number.
5556
*
5657
* `output = "ReturnValue"` simply means the result of the call itself.
5758
*
@@ -64,7 +65,8 @@ extensible predicate sourceModel(
6465

6566
/**
6667
* Holds if in a call to the function with canonical path `path`, the value referred
67-
* to by `input` is a flow sink of the given `kind`.
68+
* to by `input` is a flow sink of the given `kind` and `madId` is the data
69+
* extension row number.
6870
*
6971
* For example, `input = Argument[0]` means the first argument of the call.
7072
*
@@ -77,7 +79,8 @@ extensible predicate sinkModel(
7779

7880
/**
7981
* Holds if in a call to the function with canonical path `path`, the value referred
80-
* to by `input` can flow to the value referred to by `output`.
82+
* to by `input` can flow to the value referred to by `output` and `madId` is the data
83+
* extension row number.
8184
*
8285
* `kind` should be either `value` or `taint`, for value-preserving or taint-preserving
8386
* steps, respectively.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,10 @@ module Impl {
123123
}
124124

125125
class CallExprMethodCall extends Call instanceof CallExpr {
126-
Path qualifier;
127126
string methodName;
128127
boolean selfIsRef;
129128

130-
CallExprMethodCall() { callIsMethodCall(this, qualifier, methodName, selfIsRef) }
129+
CallExprMethodCall() { callIsMethodCall(this, _, methodName, selfIsRef) }
131130

132131
/**
133132
* Holds if this call must have an explicit borrow for the `self` argument,

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,7 @@ final class TypeBoundTypeAbstraction extends TypeAbstraction, TypeBound {
620620
}
621621

622622
final class SelfTypeBoundTypeAbstraction extends TypeAbstraction, Name {
623-
private TraitTypeAbstraction trait;
624-
625-
SelfTypeBoundTypeAbstraction() { trait.getName() = this }
623+
SelfTypeBoundTypeAbstraction() { any(TraitTypeAbstraction trait).getName() = this }
626624

627625
override TypeParameter getATypeParameter() { none() }
628626
}

0 commit comments

Comments
 (0)