Skip to content

Commit c3b10bf

Browse files
committed
Rust: patch cfg implementation
1 parent 80d32a2 commit c3b10bf

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ class FunctionTree extends StandardPostOrderTree instanceof Function {
6969

7070
class BlockExprTree extends StandardPostOrderTree instanceof BlockExpr {
7171
override ControlFlowTree getChildNode(int i) {
72-
result = super.getStatement(i)
72+
result = super.getStmtList().getStatement(i)
7373
or
74-
not exists(super.getStatement(i)) and
75-
(exists(super.getStatement(i - 1)) or i = 0) and
76-
result = super.getTail()
74+
not exists(super.getStmtList().getStatement(i)) and
75+
(exists(super.getStmtList().getStatement(i - 1)) or i = 0) and
76+
result = super.getStmtList().getTailExpr()
7777
}
7878
}
7979

8080
class CallExprTree extends StandardPostOrderTree instanceof CallExpr {
81-
override ControlFlowTree getChildNode(int i) { result = super.getArg(i) }
81+
override ControlFlowTree getChildNode(int i) { result = super.getArgList().getArg(i) }
8282
}
8383

8484
class BinaryOpExprTree extends StandardPostOrderTree instanceof BinaryExpr {
@@ -124,6 +124,3 @@ class LetExprTree extends StandardPostOrderTree instanceof LetExpr {
124124
class LiteralExprTree extends LeafTree instanceof LiteralExpr { }
125125

126126
class PathExprTree extends LeafTree instanceof PathExpr { }
127-
128-
// A leaf tree for unimplemented nodes in the AST.
129-
class UnimplementedTree extends LeafTree instanceof Unimplemented { }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ module Impl {
2525
* ```
2626
*/
2727
class Function extends Generated::Function {
28-
override string toString() { result = this.getName() }
28+
override string toString() { result = this.getName().getText() }
2929
}
3030
}

0 commit comments

Comments
 (0)