Skip to content

Commit d760dac

Browse files
committed
Rust: Call refactor follow-up fixes
1 parent 8b89e15 commit d760dac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module Impl {
9595
* layer, we do not check that the resolved target is a method in the charpred,
9696
* instead we check this in `getPositionalArgument` and `getReceiver`.
9797
*/
98-
class CallExprMethodCall extends CallImpl::MethodCall instanceof CallExprCall {
98+
class CallExprMethodCall extends CallImpl::MethodCall, CallExprCall {
9999
CallExprMethodCall() { not this instanceof DynamicCallExpr }
100100

101101
private predicate isInFactMethodCall() { this.getResolvedTarget() instanceof Method }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module Impl {
140140
private class OperationMethodCall extends CallImpl::MethodCall instanceof Operation {
141141
OperationMethodCall() { super.isOverloaded(_, _, _) }
142142

143-
override Expr getPositionalArgument(int i) { result = super.getOperand(i + 1) }
143+
override Expr getPositionalArgument(int i) { result = super.getOperand(i + 1) and i >= 0 }
144144

145145
override Expr getReceiver() { result = super.getOperand(0) }
146146
}

0 commit comments

Comments
 (0)