From 0a27a8c2559a40c21ff78a1b4762004490434ed7 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Mon, 4 Aug 2025 15:08:26 +0200 Subject: [PATCH 1/2] Java: Assume normal termination in post-dominance. --- java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll b/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll index 844371da36b8..e974f711ec45 100644 --- a/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll +++ b/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll @@ -57,7 +57,7 @@ private module Input implements BB::InputSig { * Holds if `node` represents an exit node to be used when calculating * post dominance. */ - predicate nodeIsPostDominanceExit(Node node) { node instanceof ControlFlow::ExitNode } + predicate nodeIsPostDominanceExit(Node node) { node instanceof ControlFlow::NormalExitNode } } private module BbImpl = BB::Make; From 273429d14a55972d3da06339a16262bd7a6332e7 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Tue, 5 Aug 2025 08:58:05 +0200 Subject: [PATCH 2/2] Java: Accept qltest output --- .../controlflow/basic/strictPostDominance.expected | 6 ++++++ .../controlflow/basic/strictPostDominance.expected | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/java/ql/test-kotlin1/library-tests/controlflow/basic/strictPostDominance.expected b/java/ql/test-kotlin1/library-tests/controlflow/basic/strictPostDominance.expected index 9971f41a3be2..625fde1c41e5 100644 --- a/java/ql/test-kotlin1/library-tests/controlflow/basic/strictPostDominance.expected +++ b/java/ql/test-kotlin1/library-tests/controlflow/basic/strictPostDominance.expected @@ -208,6 +208,12 @@ | Test.kt:101:5:103:5 | ... -> ... | Test.kt:101:5:103:5 | ; | | Test.kt:101:5:103:5 | ; | Test.kt:100:25:110:1 | { ... } | | Test.kt:102:9:102:25 | throw ... | Test.kt:101:33:103:5 | { ... } | +| Test.kt:105:5:109:5 | ; | Test.kt:100:25:110:1 | { ... } | +| Test.kt:105:5:109:5 | ; | Test.kt:101:5:103:5 | ... -> ... | +| Test.kt:105:5:109:5 | ; | Test.kt:101:5:103:5 | ; | +| Test.kt:105:9:107:5 | ... -> ... | Test.kt:100:25:110:1 | { ... } | +| Test.kt:105:9:107:5 | ... -> ... | Test.kt:101:5:103:5 | ... -> ... | +| Test.kt:105:9:107:5 | ... -> ... | Test.kt:101:5:103:5 | ; | | Test.kt:105:9:107:5 | ... -> ... | Test.kt:105:5:109:5 | ; | | Test.kt:106:9:106:29 | ; | Test.kt:105:20:107:5 | { ... } | | Test.kt:108:9:108:29 | ; | Test.kt:107:27:109:5 | { ... } | diff --git a/java/ql/test-kotlin2/library-tests/controlflow/basic/strictPostDominance.expected b/java/ql/test-kotlin2/library-tests/controlflow/basic/strictPostDominance.expected index 257d82fc1a7f..df70e61a9785 100644 --- a/java/ql/test-kotlin2/library-tests/controlflow/basic/strictPostDominance.expected +++ b/java/ql/test-kotlin2/library-tests/controlflow/basic/strictPostDominance.expected @@ -208,6 +208,12 @@ | Test.kt:101:9:103:5 | ... -> ... | Test.kt:100:25:110:1 | { ... } | | Test.kt:101:9:103:5 | ... -> ... | Test.kt:101:5:103:5 | ; | | Test.kt:102:9:102:25 | throw ... | Test.kt:101:33:103:5 | { ... } | +| Test.kt:105:5:109:5 | ; | Test.kt:100:25:110:1 | { ... } | +| Test.kt:105:5:109:5 | ; | Test.kt:101:5:103:5 | ; | +| Test.kt:105:5:109:5 | ; | Test.kt:101:9:103:5 | ... -> ... | +| Test.kt:105:9:107:5 | ... -> ... | Test.kt:100:25:110:1 | { ... } | +| Test.kt:105:9:107:5 | ... -> ... | Test.kt:101:5:103:5 | ; | +| Test.kt:105:9:107:5 | ... -> ... | Test.kt:101:9:103:5 | ... -> ... | | Test.kt:105:9:107:5 | ... -> ... | Test.kt:105:5:109:5 | ; | | Test.kt:106:9:106:29 | ; | Test.kt:105:20:107:5 | { ... } | | Test.kt:108:9:108:29 | ; | Test.kt:107:27:109:5 | { ... } |