Skip to content

Commit bba7cc2

Browse files
committed
wip2
1 parent b86a557 commit bba7cc2

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ module ExprTrees {
292292
}
293293
}
294294

295-
class CallExprTree extends StandardPostOrderTree instanceof ParenArgsExpr {
295+
class ParenArgsExprTree extends StandardPostOrderTree instanceof ParenArgsExpr {
296296
override AstNode getChildNode(int i) {
297297
i = 0 and result = super.getBase()
298298
or

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,8 +1015,10 @@ private module Cached {
10151015
cached
10161016
newtype TParameterPosition =
10171017
TPositionalParameterPosition(int i) {
1018-
i in [0 .. max([any(ParamList l).getNumberOfParams(), any(ArgList l).getNumberOfArgs()]) - 1] or
1019-
FlowSummaryImpl::ParsePositions::isParsedArgumentPosition(_, i) or
1018+
i in [0 .. max([any(ParamList l).getNumberOfParams(), any(ArgList l).getNumberOfArgs()]) - 1]
1019+
or
1020+
FlowSummaryImpl::ParsePositions::isParsedArgumentPosition(_, i)
1021+
or
10201022
FlowSummaryImpl::ParsePositions::isParsedParameterPosition(_, i)
10211023
} or
10221024
TClosureSelfParameterPosition() or

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,7 @@ predicate capturedCallWrite(Expr call, BasicBlock bb, int i, Variable v) {
188188

189189
/** Holds if `v` may be mutably borrowed in `e`. */
190190
private predicate mutablyBorrows(Expr e, Variable v) {
191-
(
192-
e = any(MethodCallExpr mc).getReceiver()
193-
or
194-
e = any(IndexExpr ie).getBase()
195-
or
196-
e = any(Operation o | o.isOverloaded(_, _, any(int borrows | borrows >= 1))).getOperand(0)
197-
) and
191+
e = any(MethodCallExpr mc).getReceiver() and
198192
e.(VariableAccess).getVariable() = v and
199193
v.isMutable()
200194
or
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
instances
2-
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) |
3-
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) |
2+
| gen_method_call_expr.rs:8:5:8:13 | x.foo(...) |
3+
| gen_method_call_expr.rs:9:5:9:25 | x.foo(...) |
44
getArgList
5-
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) | gen_method_call_expr.rs:5:10:5:13 | ArgList |
6-
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | gen_method_call_expr.rs:6:22:6:25 | ArgList |
5+
| gen_method_call_expr.rs:8:5:8:13 | x.foo(...) | gen_method_call_expr.rs:8:10:8:13 | ArgList |
6+
| gen_method_call_expr.rs:9:5:9:25 | x.foo(...) | gen_method_call_expr.rs:9:22:9:25 | ArgList |
77
getAttr
88
getGenericArgList
9-
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | gen_method_call_expr.rs:6:10:6:21 | <...> |
9+
| gen_method_call_expr.rs:9:5:9:25 | x.foo(...) | gen_method_call_expr.rs:9:10:9:21 | <...> |
1010
getIdentifier
11-
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) | gen_method_call_expr.rs:5:7:5:9 | foo |
12-
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | gen_method_call_expr.rs:6:7:6:9 | foo |
11+
| gen_method_call_expr.rs:8:5:8:13 | x.foo(...) | gen_method_call_expr.rs:8:7:8:9 | foo |
12+
| gen_method_call_expr.rs:9:5:9:25 | x.foo(...) | gen_method_call_expr.rs:9:7:9:9 | foo |
1313
getReceiver
14-
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) | gen_method_call_expr.rs:5:5:5:5 | x |
15-
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | gen_method_call_expr.rs:6:5:6:5 | x |
14+
| gen_method_call_expr.rs:8:5:8:13 | x.foo(...) | gen_method_call_expr.rs:8:5:8:5 | x |
15+
| gen_method_call_expr.rs:9:5:9:25 | x.foo(...) | gen_method_call_expr.rs:9:5:9:5 | x |
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
multipleCallTargets
2-
| main.rs:228:10:228:14 | * ... |
32
| main.rs:236:11:236:15 | * ... |
43
| main.rs:272:13:272:29 | * ... |

0 commit comments

Comments
 (0)