Skip to content

Commit 221aebc

Browse files
committed
C#: Fix bug in AssignOperationWithExpandedAssignment::last
1 parent 355edcb commit 221aebc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

csharp/ql/src/semmle/code/csharp/controlflow/internal/ControlFlowGraphImpl.qll

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,13 @@ module Expressions {
623623
* tracking.
624624
*/
625625
private class AssignOperationWithExpandedAssignment extends AssignOperation, ControlFlowTree {
626-
final override predicate first(ControlFlowElement first) {
627-
first(this.getExpandedAssignment(), first)
628-
}
626+
private Expr expanded;
629627

630-
final override predicate last(ControlFlowElement last, Completion c) {
631-
last = this.getExpandedAssignment() and
632-
last(this.getExpandedAssignment(), last, c)
633-
}
628+
AssignOperationWithExpandedAssignment() { expanded = this.getExpandedAssignment() }
629+
630+
final override predicate first(ControlFlowElement first) { first(expanded, first) }
631+
632+
final override predicate last(ControlFlowElement last, Completion c) { last(expanded, last, c) }
634633

635634
final override predicate propagatesAbnormal(ControlFlowElement child) { none() }
636635

0 commit comments

Comments
 (0)