Skip to content

Commit 69cdef7

Browse files
committed
Rust: fix ArrayRepeatExpr control flow
1 parent 6ec89c1 commit 69cdef7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,18 @@ class TypeReprTree extends LeafTree instanceof TypeRepr { }
204204
* `LetExpr`s.
205205
*/
206206
module ExprTrees {
207-
class ArrayExprTree extends StandardPostOrderTree, ArrayExpr {
207+
class ArrayListExprTree extends StandardPostOrderTree, ArrayListExpr {
208208
override AstNode getChildNode(int i) { result = this.getExpr(i) }
209209
}
210210

211+
class ArrayRepeatExprTree extends StandardPostOrderTree, ArrayRepeatExpr {
212+
override AstNode getChildNode(int i) {
213+
i = 0 and result = this.getRepeatOperand()
214+
or
215+
i = 1 and result = this.getRepeatLength()
216+
}
217+
}
218+
211219
class AsmExprTree extends LeafTree instanceof AsmExpr { }
212220

213221
class AwaitExprTree extends StandardPostOrderTree instanceof AwaitExpr {

0 commit comments

Comments
 (0)