Skip to content

Commit cdd0fbe

Browse files
committed
WIP expose SuccessorType on CFG edges
1 parent 3d3715c commit cdd0fbe

File tree

2 files changed

+396
-158
lines changed

2 files changed

+396
-158
lines changed

go/ql/lib/semmle/go/controlflow/ControlFlowGraph.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import go
66
private import ControlFlowGraphImpl
7+
private import codeql.controlflow.SuccessorType
78

89
/** Provides helper predicates for mapping btween CFG nodes and the AST. */
910
module ControlFlow {
@@ -40,6 +41,9 @@ module ControlFlow {
4041
/** Gets a node that directly follows this one in the control-flow graph. */
4142
Node getASuccessor() { result = CFG::succ(this) }
4243

44+
/** Gets a node that directly follows this one in the control-flow graph. */
45+
Node getASuccessor(SuccessorType t) { result = CFG::succ(this, t) }
46+
4347
/** Gets a node that directly precedes this one in the control-flow graph. */
4448
Node getAPredecessor() { this = result.getASuccessor() }
4549

@@ -350,4 +354,6 @@ module ControlFlow {
350354
}
351355
}
352356

357+
class ControlFlowNode = ControlFlow::Node;
358+
353359
class Write = ControlFlow::WriteNode;

0 commit comments

Comments
 (0)