Skip to content

Commit 37997c0

Browse files
committed
Rust: Fix some Ql4Ql violations.
1 parent b4d6cb6 commit 37997c0

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ private import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprB
5252
/**
5353
* Holds if in a call to the function with canonical path `path`, the value referred
5454
* to by `output` is a flow source of the given `kind`.
55+
* The `madId` is the data extension row number.
5556
*
5657
* `output = "ReturnValue"` simply means the result of the call itself.
5758
*
@@ -65,6 +66,7 @@ extensible predicate sourceModel(
6566
/**
6667
* Holds if in a call to the function with canonical path `path`, the value referred
6768
* to by `input` is a flow sink of the given `kind`.
69+
* The `madId` is the data extension row number.
6870
*
6971
* For example, `input = Argument[0]` means the first argument of the call.
7072
*
@@ -78,6 +80,7 @@ extensible predicate sinkModel(
7880
/**
7981
* Holds if in a call to the function with canonical path `path`, the value referred
8082
* to by `input` can flow to the value referred to by `output`.
83+
* The `madId` is the data 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)