Skip to content

Commit 0f3dd6d

Browse files
committed
Java: IPA the CFG
1 parent 0f5786e commit 0f3dd6d

File tree

79 files changed

+451
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+451
-344
lines changed

java/ql/consistency-queries/cfgDeadEnds.ql

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import java
2-
import semmle.code.java.ControlFlowGraph
32

4-
predicate shouldBeDeadEnd(ControlFlowNode n) {
3+
predicate shouldBeDeadEnd(ExprParent n) {
54
n instanceof BreakStmt and n.getFile().isKotlinSourceFile() // TODO
65
or
76
n instanceof Interface // TODO
@@ -55,8 +54,11 @@ predicate shouldBeDeadEnd(ControlFlowNode n) {
5554
n = any(ConstCase c).getValue(_) // TODO
5655
}
5756

58-
from ControlFlowNode n, string s
57+
from ControlFlowNode n, ExprParent astnode, string s
5958
where
60-
// TODO: exists(n.getASuccessor()) and shouldBeDeadEnd(n) and s = "expected dead end"
61-
not exists(n.getASuccessor()) and not shouldBeDeadEnd(n) and s = "unexpected dead end"
62-
select n, n.getPrimaryQlClasses(), s
59+
astnode = n.getAstNode() and
60+
// TODO: exists(n.getASuccessor()) and shouldBeDeadEnd(n.getAstNode()) and s = "expected dead end"
61+
not exists(n.getASuccessor()) and
62+
not shouldBeDeadEnd(astnode) and
63+
s = "unexpected dead end"
64+
select n, astnode.getPrimaryQlClasses(), s

0 commit comments

Comments
 (0)