Skip to content

Commit 831a66d

Browse files
committed
Dataflow: Add getANonHiddenSuccessor to StagePathNodeImpl.
1 parent e594e72 commit 831a66d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,6 +2570,38 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
25702570

25712571
abstract StagePathNodeImpl getASuccessorImpl(string label);
25722572

2573+
private StagePathNodeImpl getASuccessorIfHidden(string label) {
2574+
this.isHidden() and
2575+
result = this.getASuccessorImpl(label)
2576+
}
2577+
2578+
private StagePathNodeImpl getASuccessorFromNonHidden(string label) {
2579+
result = this.getASuccessorImpl(label) and
2580+
not this.isHidden()
2581+
or
2582+
exists(string l1, string l2 |
2583+
result = this.getASuccessorFromNonHidden(l1).getASuccessorIfHidden(l2) and
2584+
label = mergeLabels(l1, l2)
2585+
)
2586+
}
2587+
2588+
final StagePathNodeImpl getANonHiddenSuccessor(string label) {
2589+
result = this.getASuccessorFromNonHidden(label) and not result.isHidden()
2590+
}
2591+
2592+
predicate isHidden() {
2593+
not Config::includeHiddenNodes() and
2594+
(
2595+
hiddenNode(this.getNodeEx().asNode()) and
2596+
not this.isSource() and
2597+
not this instanceof StagePathNodeSink
2598+
or
2599+
this.getNodeEx() instanceof TNodeImplicitRead
2600+
or
2601+
hiddenNode(this.getNodeEx().asParamReturnNode())
2602+
)
2603+
}
2604+
25732605
/** Gets a textual representation of this element. */
25742606
abstract string toString();
25752607

0 commit comments

Comments
 (0)