Skip to content

Commit 8f9174e

Browse files
committed
Update instantiation for Java
1 parent e3ac376 commit 8f9174e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

java/ql/lib/semmle/code/java/ControlFlowGraph.qll

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,16 +1776,25 @@ class ConditionNode extends ControlFlow::Node {
17761776
ExprParent getCondition() { result = this.asExpr() or result = this.asStmt() }
17771777
}
17781778

1779-
private import codeql.controlflow.PrintGraph as PrintGraph
1779+
private import codeql.util.PrintGraph as PrintGraph
17801780

17811781
private module PrintGraphInput implements PrintGraph::InputSig<Location> {
17821782
private import java as J
17831783

17841784
class Callable = J::Callable;
17851785

1786-
class ControlFlowNode = J::ControlFlowNode;
1786+
final private class FinalControlFlowNode = J::ControlFlowNode;
17871787

1788-
ControlFlowNode getASuccessor(ControlFlowNode n, SuccessorType t) { result = n.getASuccessor(t) }
1788+
class Node extends FinalControlFlowNode {
1789+
string getOrderDisambiguation() { result = "" }
1790+
}
1791+
1792+
predicate edge(Node node1, string s, Node node2) {
1793+
exists(SuccessorType t |
1794+
node2 = node1.getASuccessor(t) and
1795+
if t instanceof DirectSuccessor then s = "" else s = t.toString()
1796+
)
1797+
}
17891798
}
17901799

17911800
/** Provides utilities for visualising the CFG. */

0 commit comments

Comments
 (0)