Skip to content

Commit 0f2b917

Browse files
committed
Allow flow out of phi-nodes
1 parent 1c90e6c commit 0f2b917

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

go/ql/lib/semmle/go/dataflow/internal/DataFlowPrivate.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ OutNode getAnOutNode(DataFlowCall call, ReturnKind kind) {
4040
)
4141
}
4242

43+
predicate test0(Node nodeFrom, Node nodeTo) {
44+
nodeFrom.getStartLine() = 692 and
45+
nodeFrom.getFile().getBaseName() = "pprof.go" and
46+
basicLocalFlowStep(nodeFrom, nodeTo)
47+
}
48+
4349
/**
4450
* Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local
4551
* (intra-procedural) step, not taking function models into account.
@@ -74,7 +80,7 @@ predicate basicLocalFlowStep(Node nodeFrom, Node nodeTo) {
7480
or
7581
// SSA defn -> first SSA use
7682
exists(SsaDefinition pred, IR::Instruction succ | succ = pred.getAFirstUse() |
77-
(pred instanceof SsaExplicitDefinition or pred instanceof SsaVariableCapture) and
83+
// (pred instanceof SsaExplicitDefinition or pred instanceof SsaVariableCapture) and
7884
nodeFrom = ssaNode(pred.getVariable()) and
7985
nodeTo = instructionNode(succ)
8086
)

0 commit comments

Comments
 (0)