Skip to content

Commit c59d20a

Browse files
authored
Merge pull request #20163 from aschackmull/java/postdom-normal
Java: Assume normal termination in post-dominance.
2 parents 6e90823 + 273429d commit c59d20a

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private module Input implements BB::InputSig<Location> {
5757
* Holds if `node` represents an exit node to be used when calculating
5858
* post dominance.
5959
*/
60-
predicate nodeIsPostDominanceExit(Node node) { node instanceof ControlFlow::ExitNode }
60+
predicate nodeIsPostDominanceExit(Node node) { node instanceof ControlFlow::NormalExitNode }
6161
}
6262

6363
private module BbImpl = BB::Make<Location, Input>;

java/ql/test-kotlin1/library-tests/controlflow/basic/strictPostDominance.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@
208208
| Test.kt:101:5:103:5 | ... -> ... | Test.kt:101:5:103:5 | <Expr>; |
209209
| Test.kt:101:5:103:5 | <Expr>; | Test.kt:100:25:110:1 | { ... } |
210210
| Test.kt:102:9:102:25 | throw ... | Test.kt:101:33:103:5 | { ... } |
211+
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:100:25:110:1 | { ... } |
212+
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:101:5:103:5 | ... -> ... |
213+
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:101:5:103:5 | <Expr>; |
214+
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:100:25:110:1 | { ... } |
215+
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:101:5:103:5 | ... -> ... |
216+
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:101:5:103:5 | <Expr>; |
211217
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:105:5:109:5 | <Expr>; |
212218
| Test.kt:106:9:106:29 | <Expr>; | Test.kt:105:20:107:5 | { ... } |
213219
| Test.kt:108:9:108:29 | <Expr>; | Test.kt:107:27:109:5 | { ... } |

java/ql/test-kotlin2/library-tests/controlflow/basic/strictPostDominance.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@
208208
| Test.kt:101:9:103:5 | ... -> ... | Test.kt:100:25:110:1 | { ... } |
209209
| Test.kt:101:9:103:5 | ... -> ... | Test.kt:101:5:103:5 | <Expr>; |
210210
| Test.kt:102:9:102:25 | throw ... | Test.kt:101:33:103:5 | { ... } |
211+
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:100:25:110:1 | { ... } |
212+
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:101:5:103:5 | <Expr>; |
213+
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:101:9:103:5 | ... -> ... |
214+
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:100:25:110:1 | { ... } |
215+
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:101:5:103:5 | <Expr>; |
216+
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:101:9:103:5 | ... -> ... |
211217
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:105:5:109:5 | <Expr>; |
212218
| Test.kt:106:9:106:29 | <Expr>; | Test.kt:105:20:107:5 | { ... } |
213219
| Test.kt:108:9:108:29 | <Expr>; | Test.kt:107:27:109:5 | { ... } |

0 commit comments

Comments
 (0)