Skip to content

Commit 4344e70

Browse files
committed
PS: Include certain statements as local source nodes.
1 parent 4f58b19 commit 4344e70

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

powershell/ql/lib/semmle/code/powershell/dataflow/internal/DataFlowPrivate.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,15 @@ private module Cached {
293293
n instanceof ParameterNode
294294
or
295295
// Expressions that can't be reached from another entry definition or expression
296-
n instanceof ExprNode and
296+
(
297+
n instanceof ExprNode
298+
or
299+
exists(CfgNodes::StmtNodes::AssignStmtCfgNode assign | assign.getRightHandSide() = n.asStmt())
300+
or
301+
n.asStmt() instanceof CfgNodes::StmtNodes::CmdCfgNode
302+
or
303+
exists(CfgNodes::StmtNodes::PipelineCfgNode pipeline | n.asStmt() = pipeline.getAComponent())
304+
) and
297305
not reachedFromExprOrEntrySsaDef(n)
298306
or
299307
// Ensure all entry SSA definitions are local sources, except those that correspond

0 commit comments

Comments
 (0)