Skip to content

Commit 6e493f2

Browse files
committed
Address review comments
1 parent 8d8bbd5 commit 6e493f2

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,6 @@ class MatchExprTree extends PostOrderTree instanceof MatchExpr {
374374
or
375375
// Edge from the end of each arm to the match expression.
376376
last(super.getArm(_).getExpr(), pred, c) and succ = this and completionIsNormal(c)
377-
or
378-
// Edge from the end of last arm to the match expression.
379-
last(super.getLastArm().getExpr(), pred, c) and succ = this and completionIsNormal(c)
380377
}
381378
}
382379

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class ConditionalSuccessorImpl extends SuccessorTypeImpl {
3434
boolean value;
3535

3636
bindingset[value]
37-
ConditionalSuccessorImpl() { any() }
37+
ConditionalSuccessorImpl() { exists(value) }
3838

3939
/** Gets the Boolean value of this successor. */
4040
boolean getValue() { result = value }

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ module Impl {
4141
/**
4242
* Gets the number of arms of this match expression.
4343
*/
44-
int getNumberOfArms() { result = count(int i | exists(this.getArm(i))) }
45-
46-
/**
47-
* Gets the last arm of this match expression.
48-
*/
49-
MatchArm getLastArm() { result = this.getArm(this.getNumberOfArms() - 1) }
44+
int getNumberOfArms() { result = this.getMatchArmList().getNumberOfArms() }
5045
}
5146
}

0 commit comments

Comments
 (0)