Skip to content

Commit 9278f03

Browse files
committed
PS: Include parameter positions for top levels.
1 parent 97d5af7 commit 9278f03

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ private module Cached {
241241
call = ns.getABindingCall() and
242242
exists(call.getArgument(pos))
243243
)
244+
or
245+
// Uncalled functions are never the target of a call returned by
246+
// `ns.getABindingCall()`, but those parameters should still have
247+
// positions since SSA depends on this.
248+
// In particular, global scope is also an uncalled function.
249+
any(Parameter p).getIndexExcludingPipelines() = pos and
250+
ns.isEmpty()
244251
} or
245252
TPipelineParameter()
246253
}

0 commit comments

Comments
 (0)