Commit 9e69738
Shared CFG: add defaulted getLoopElse to AstSig
Adds a new defaulted signature predicates to the shared CFG library:
- getLoopElse: `else` block of a loop statement, if
any (used by Python's `while-else` / `for-else` constructs).
The predicate defaults to `none()`, so behaviour is unchanged for any
language that doesn't override it (verified by re-running
java/ql/test/library-tests/controlflow/).
The Make0 succession rules are extended:
- WhileStmt/ForeachStmt: route the loop-exit edge through the else
block before reaching the after-position.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 8179bff commit 9e69738
1 file changed
Lines changed: 25 additions & 3 deletions
File tree
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
227 | 234 | | |
228 | 235 | | |
229 | 236 | | |
| |||
1578 | 1585 | | |
1579 | 1586 | | |
1580 | 1587 | | |
1581 | | - | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1582 | 1593 | | |
1583 | 1594 | | |
1584 | 1595 | | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
1585 | 1599 | | |
1586 | 1600 | | |
1587 | 1601 | | |
| |||
1590 | 1604 | | |
1591 | 1605 | | |
1592 | 1606 | | |
1593 | | - | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
1594 | 1612 | | |
1595 | 1613 | | |
1596 | 1614 | | |
| |||
1603 | 1621 | | |
1604 | 1622 | | |
1605 | 1623 | | |
1606 | | - | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
1607 | 1629 | | |
1608 | 1630 | | |
1609 | 1631 | | |
| |||
0 commit comments