Merge pull request #111 from microsoft/powershell-more-control-flow

PS: More control flow
This commit is contained in:
Mathias Vorreiter Pedersen
2024-10-03 12:30:51 +02:00
committed by GitHub
9 changed files with 1264 additions and 6 deletions

View File

@@ -43,6 +43,9 @@ private predicate completionIsValidForStmt(Ast n, Completion c) {
unconditional = false and
c instanceof SimpleCompletion
)
or
n instanceof ExitStmt and
c instanceof ExitCompletion
}
/** A completion of a statement or an expression. */

View File

@@ -82,6 +82,18 @@ module Trees {
}
}
class AttributeTree extends StandardPostOrderTree instanceof Attribute {
override AstNode getChildNode(int i) {
result = super.getPositionalArgument(i)
or
exists(int n |
n = super.getNumberOfPositionalArguments() and
i >= n and
result = super.getNamedArgument(i - n)
)
}
}
abstract class ScriptBlockTree extends ControlFlowTree instanceof ScriptBlock {
abstract predicate succEntry(AstNode n, Completion c);
@@ -353,6 +365,11 @@ module Trees {
last(super.getIterator(), pred, c) and
completionIsNormal(c) and
first(super.getCondition(), succ)
or
// Body -> condition
last(this.getBody(), pred, c) and
c.continuesLoop() and
first(super.getCondition(), succ)
}
}
@@ -421,6 +438,16 @@ module Trees {
}
}
class MemberExprTree extends StandardPostOrderTree instanceof MemberExpr {
override AstNode getChildNode(int i) {
i = 0 and result = super.getBase()
or
i = 1 and result = super.getMember()
}
}
class CmdParameterTree extends LeafTree instanceof CmdParameter { }
class IfStmtTree extends PreOrderTree instanceof IfStmt {
final override predicate propagatesAbnormal(AstNode child) {
child = super.getACondition()
@@ -541,11 +568,33 @@ module Trees {
override AstNode getChildNode(int i) { i = 0 and result = super.getOperand() }
}
class ScriptBlockExprTree extends LeafTree instanceof ScriptBlockExpr { }
class ConvertExprTree extends StandardPostOrderTree instanceof ConvertExpr {
override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() }
}
class IndexExprTree extends StandardPostOrderTree instanceof IndexExpr {
override AstNode getChildNode(int i) {
i = 0 and result = super.getBase()
or
i = 1 and result = super.getIndex()
}
}
class ParenExprTree extends StandardPostOrderTree instanceof ParenExpr {
override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() }
}
class TypeNameExprTree extends LeafTree instanceof TypeNameExpr { }
class ArrayLiteralTree extends StandardPostOrderTree instanceof ArrayLiteral {
override AstNode getChildNode(int i) { result = super.getElement(i) }
}
class TypeConstraintTree extends LeafTree instanceof TypeConstraint { }
class ArrayExprTree extends StandardPostOrderTree instanceof ArrayExpr {
override AstNode getChildNode(int i) { i = 0 and result = super.getStmtBlock() }
}
class CatchClauseTree extends PreOrderTree instanceof CatchClause {
final override predicate propagatesAbnormal(Ast child) { none() }
@@ -584,6 +633,10 @@ module Trees {
}
}
class TypeConstraintTree extends LeafTree instanceof TypeConstraint { }
class TypeTree extends LeafTree instanceof Type { }
class TryStmtBlock extends PreOrderTree instanceof TryStmt {
final override predicate propagatesAbnormal(AstNode child) { child = super.getFinally() }
@@ -616,19 +669,71 @@ module Trees {
}
}
class ExpandableSubExprTree extends StandardPostOrderTree instanceof ExpandableSubExpr {
override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() }
}
class ExpandableStringExprTree extends StandardPostOrderTree instanceof ExpandableStringExpr {
override AstNode getChildNode(int i) { result = super.getExpr(i) }
}
class ReturnStmtTree extends StandardPreOrderTree instanceof ReturnStmt {
override AstNode getChildNode(int i) { i = 0 and result = super.getPipeline() }
}
class ExitStmtTre extends StandardPreOrderTree instanceof ExitStmt {
override AstNode getChildNode(int i) { i = 0 and result = super.getPipeline() }
}
class ExitStmtTree extends StandardPreOrderTree instanceof ExitStmt {
override AstNode getChildNode(int i) { i = 0 and result = super.getPipeline() }
}
class ThrowStmtTree extends StandardPreOrderTree instanceof ThrowStmt {
override AstNode getChildNode(int i) { i = 0 and result = super.getPipeline() }
}
class ConstExprTree extends LeafTree instanceof ConstExpr { }
class HashTableTree extends StandardPostOrderTree instanceof HashTableExpr {
override AstNode getChildNode(int i) {
exists(int k |
// First evaluate the key
i = 2 * k and
super.hasEntry(k, result, _)
or
// Then evaluate the value
i = 2 * k + 1 and
super.hasEntry(k, _, result)
)
}
}
class CmdExprTree extends StandardPreOrderTree instanceof CmdExpr {
override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() }
}
class CmdTree extends StandardPostOrderTree instanceof Cmd {
override AstNode getChildNode(int i) {
i = -1 and result = super.getCommand()
or
result = super.getArgument(i)
}
}
class StringConstTree extends LeafTree instanceof StringConstExpr { }
class PipelineTree extends StandardPreOrderTree instanceof Pipeline {
override AstNode getChildNode(int i) { result = super.getComponent(i) }
}
class InvokeMemberExprTree extends StandardPostOrderTree instanceof InvokeMemberExpr {
override AstNode getChildNode(int i) {
i = -1 and result = super.getQualifier()
or
result = super.getArgument(i)
}
}
}
private import Scope

View File

@@ -1,6 +1,14 @@
models
edges
| test.ps1:1:1:1:3 | [post] a [f] | test.ps1:2:6:2:8 | a [f] | provenance | |
| test.ps1:1:8:1:18 | Source | test.ps1:1:1:1:3 | [post] a [f] | provenance | |
| test.ps1:2:6:2:8 | a [f] | test.ps1:2:6:2:10 | f | provenance | |
nodes
| test.ps1:1:1:1:3 | [post] a [f] | semmle.label | [post] a [f] |
| test.ps1:1:8:1:18 | Source | semmle.label | Source |
| test.ps1:2:6:2:8 | a [f] | semmle.label | a [f] |
| test.ps1:2:6:2:10 | f | semmle.label | f |
subpaths
testFailures
#select
| test.ps1:2:6:2:10 | f | test.ps1:1:8:1:18 | Source | test.ps1:2:6:2:10 | f | $@ | test.ps1:1:8:1:18 | Source | Source |

View File

@@ -1,5 +1,5 @@
$a.f = Source "1"
Sink $a.f # $ MISSING: hasValueFlow=1
Sink $a.f # $ hasValueFlow=1
$a.f = Source "2"
$a.f = 0

View File

@@ -0,0 +1,9 @@
| test.ps1:1:1:1:4 | a1 | test.ps1:2:6:2:9 | a1 |
| test.ps1:1:7:1:13 | Source | test.ps1:1:1:1:4 | a1 |
| test.ps1:1:7:1:13 | Source | test.ps1:1:1:1:13 | ...=... |
| test.ps1:4:1:4:3 | b | test.ps1:5:4:5:6 | b |
| test.ps1:4:6:4:13 | GetBool | test.ps1:4:1:4:3 | b |
| test.ps1:4:6:4:13 | GetBool | test.ps1:4:1:4:13 | ...=... |
| test.ps1:6:5:6:8 | a2 | test.ps1:8:6:8:9 | a2 |
| test.ps1:6:11:6:17 | Source | test.ps1:6:5:6:8 | a2 |
| test.ps1:6:11:6:17 | Source | test.ps1:6:5:6:17 | ...=... |

View File

@@ -1,6 +1,227 @@
models
edges
| test.ps1:1:14:1:16 | a | test.ps1:2:10:2:12 | a | provenance | |
| test.ps1:5:6:5:16 | Source | test.ps1:6:5:6:7 | x | provenance | |
| test.ps1:6:5:6:7 | x | test.ps1:1:14:1:16 | a | provenance | |
| test.ps1:8:20:8:22 | x | test.ps1:9:10:9:12 | x | provenance | |
| test.ps1:8:24:8:26 | y | test.ps1:10:10:10:12 | y | provenance | |
| test.ps1:8:28:8:30 | z | test.ps1:11:10:11:12 | z | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:18:11:18:17 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:19:22:19:28 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:20:14:20:20 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:21:11:21:17 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:22:22:22:28 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:23:22:23:28 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:24:14:24:20 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:25:11:25:17 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:26:22:26:28 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:27:22:27:28 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:28:14:28:20 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:29:11:29:17 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:30:32:30:38 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:31:32:31:38 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:32:14:32:20 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:33:11:33:17 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:34:32:34:38 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:35:32:35:38 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:36:32:36:38 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:37:24:37:30 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:38:21:38:27 | first | provenance | |
| test.ps1:14:10:14:20 | Source | test.ps1:39:32:39:38 | first | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:18:18:18:25 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:19:11:19:18 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:20:21:20:28 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:21:21:21:28 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:22:14:22:21 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:23:11:23:18 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:24:21:24:28 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:25:21:25:28 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:26:14:26:21 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:27:11:27:18 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:28:31:28:38 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:29:21:29:28 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:30:14:30:21 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:31:11:31:18 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:32:31:32:38 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:33:31:33:38 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:34:14:34:21 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:35:24:35:31 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:36:21:36:28 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:37:31:37:38 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:38:31:38:38 | second | provenance | |
| test.ps1:15:11:15:21 | Source | test.ps1:39:24:39:31 | second | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:18:26:18:32 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:19:29:19:35 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:20:29:20:35 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:21:29:21:35 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:22:29:22:35 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:23:32:23:38 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:24:32:24:38 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:25:32:25:38 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:26:32:26:38 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:27:32:27:38 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:28:24:28:30 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:29:32:29:38 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:30:25:30:31 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:31:22:31:28 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:32:24:32:30 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:33:21:33:27 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:34:25:34:31 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:35:14:35:20 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:36:14:36:20 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:37:14:37:20 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:38:14:38:20 | third | provenance | |
| test.ps1:16:10:16:20 | Source | test.ps1:39:14:39:20 | third | provenance | |
| test.ps1:18:11:18:17 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:18:18:18:25 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:18:26:18:32 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:19:11:19:18 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:19:22:19:28 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:19:29:19:35 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:20:14:20:20 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:20:21:20:28 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:20:29:20:35 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:21:11:21:17 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:21:21:21:28 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:21:29:21:35 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:22:14:22:21 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:22:22:22:28 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:22:29:22:35 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:23:11:23:18 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:23:22:23:28 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:23:32:23:38 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:24:14:24:20 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:24:21:24:28 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:24:32:24:38 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:25:11:25:17 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:25:21:25:28 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:25:32:25:38 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:26:14:26:21 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:26:22:26:28 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:26:32:26:38 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:27:11:27:18 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:27:22:27:28 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:27:32:27:38 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:28:14:28:20 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:28:24:28:30 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:28:31:28:38 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:29:11:29:17 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:29:21:29:28 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:29:32:29:38 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:30:14:30:21 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:30:25:30:31 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:30:32:30:38 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:31:11:31:18 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:31:22:31:28 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:31:32:31:38 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:32:14:32:20 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:32:24:32:30 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:32:31:32:38 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:33:11:33:17 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:33:21:33:27 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:33:31:33:38 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:34:14:34:21 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:34:25:34:31 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:34:32:34:38 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:35:14:35:20 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:35:24:35:31 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:35:32:35:38 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:36:14:36:20 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:36:21:36:28 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:36:32:36:38 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:37:14:37:20 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:37:24:37:30 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:37:31:37:38 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:38:14:38:20 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:38:21:38:27 | first | test.ps1:8:20:8:22 | x | provenance | |
| test.ps1:38:31:38:38 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:39:14:39:20 | third | test.ps1:8:28:8:30 | z | provenance | |
| test.ps1:39:24:39:31 | second | test.ps1:8:24:8:26 | y | provenance | |
| test.ps1:39:32:39:38 | first | test.ps1:8:20:8:22 | x | provenance | |
nodes
| test.ps1:1:14:1:16 | a | semmle.label | a |
| test.ps1:2:10:2:12 | a | semmle.label | a |
| test.ps1:5:6:5:16 | Source | semmle.label | Source |
| test.ps1:6:5:6:7 | x | semmle.label | x |
| test.ps1:8:20:8:22 | x | semmle.label | x |
| test.ps1:8:24:8:26 | y | semmle.label | y |
| test.ps1:8:28:8:30 | z | semmle.label | z |
| test.ps1:9:10:9:12 | x | semmle.label | x |
| test.ps1:10:10:10:12 | y | semmle.label | y |
| test.ps1:11:10:11:12 | z | semmle.label | z |
| test.ps1:14:10:14:20 | Source | semmle.label | Source |
| test.ps1:15:11:15:21 | Source | semmle.label | Source |
| test.ps1:16:10:16:20 | Source | semmle.label | Source |
| test.ps1:18:11:18:17 | first | semmle.label | first |
| test.ps1:18:18:18:25 | second | semmle.label | second |
| test.ps1:18:26:18:32 | third | semmle.label | third |
| test.ps1:19:11:19:18 | second | semmle.label | second |
| test.ps1:19:22:19:28 | first | semmle.label | first |
| test.ps1:19:29:19:35 | third | semmle.label | third |
| test.ps1:20:14:20:20 | first | semmle.label | first |
| test.ps1:20:21:20:28 | second | semmle.label | second |
| test.ps1:20:29:20:35 | third | semmle.label | third |
| test.ps1:21:11:21:17 | first | semmle.label | first |
| test.ps1:21:21:21:28 | second | semmle.label | second |
| test.ps1:21:29:21:35 | third | semmle.label | third |
| test.ps1:22:14:22:21 | second | semmle.label | second |
| test.ps1:22:22:22:28 | first | semmle.label | first |
| test.ps1:22:29:22:35 | third | semmle.label | third |
| test.ps1:23:11:23:18 | second | semmle.label | second |
| test.ps1:23:22:23:28 | first | semmle.label | first |
| test.ps1:23:32:23:38 | third | semmle.label | third |
| test.ps1:24:14:24:20 | first | semmle.label | first |
| test.ps1:24:21:24:28 | second | semmle.label | second |
| test.ps1:24:32:24:38 | third | semmle.label | third |
| test.ps1:25:11:25:17 | first | semmle.label | first |
| test.ps1:25:21:25:28 | second | semmle.label | second |
| test.ps1:25:32:25:38 | third | semmle.label | third |
| test.ps1:26:14:26:21 | second | semmle.label | second |
| test.ps1:26:22:26:28 | first | semmle.label | first |
| test.ps1:26:32:26:38 | third | semmle.label | third |
| test.ps1:27:11:27:18 | second | semmle.label | second |
| test.ps1:27:22:27:28 | first | semmle.label | first |
| test.ps1:27:32:27:38 | third | semmle.label | third |
| test.ps1:28:14:28:20 | first | semmle.label | first |
| test.ps1:28:24:28:30 | third | semmle.label | third |
| test.ps1:28:31:28:38 | second | semmle.label | second |
| test.ps1:29:11:29:17 | first | semmle.label | first |
| test.ps1:29:21:29:28 | second | semmle.label | second |
| test.ps1:29:32:29:38 | third | semmle.label | third |
| test.ps1:30:14:30:21 | second | semmle.label | second |
| test.ps1:30:25:30:31 | third | semmle.label | third |
| test.ps1:30:32:30:38 | first | semmle.label | first |
| test.ps1:31:11:31:18 | second | semmle.label | second |
| test.ps1:31:22:31:28 | third | semmle.label | third |
| test.ps1:31:32:31:38 | first | semmle.label | first |
| test.ps1:32:14:32:20 | first | semmle.label | first |
| test.ps1:32:24:32:30 | third | semmle.label | third |
| test.ps1:32:31:32:38 | second | semmle.label | second |
| test.ps1:33:11:33:17 | first | semmle.label | first |
| test.ps1:33:21:33:27 | third | semmle.label | third |
| test.ps1:33:31:33:38 | second | semmle.label | second |
| test.ps1:34:14:34:21 | second | semmle.label | second |
| test.ps1:34:25:34:31 | third | semmle.label | third |
| test.ps1:34:32:34:38 | first | semmle.label | first |
| test.ps1:35:14:35:20 | third | semmle.label | third |
| test.ps1:35:24:35:31 | second | semmle.label | second |
| test.ps1:35:32:35:38 | first | semmle.label | first |
| test.ps1:36:14:36:20 | third | semmle.label | third |
| test.ps1:36:21:36:28 | second | semmle.label | second |
| test.ps1:36:32:36:38 | first | semmle.label | first |
| test.ps1:37:14:37:20 | third | semmle.label | third |
| test.ps1:37:24:37:30 | first | semmle.label | first |
| test.ps1:37:31:37:38 | second | semmle.label | second |
| test.ps1:38:14:38:20 | third | semmle.label | third |
| test.ps1:38:21:38:27 | first | semmle.label | first |
| test.ps1:38:31:38:38 | second | semmle.label | second |
| test.ps1:39:14:39:20 | third | semmle.label | third |
| test.ps1:39:24:39:31 | second | semmle.label | second |
| test.ps1:39:32:39:38 | first | semmle.label | first |
subpaths
testFailures
#select
| test.ps1:2:10:2:12 | a | test.ps1:5:6:5:16 | Source | test.ps1:2:10:2:12 | a | $@ | test.ps1:5:6:5:16 | Source | Source |
| test.ps1:9:10:9:12 | x | test.ps1:14:10:14:20 | Source | test.ps1:9:10:9:12 | x | $@ | test.ps1:14:10:14:20 | Source | Source |
| test.ps1:10:10:10:12 | y | test.ps1:15:11:15:21 | Source | test.ps1:10:10:10:12 | y | $@ | test.ps1:15:11:15:21 | Source | Source |
| test.ps1:11:10:11:12 | z | test.ps1:16:10:16:20 | Source | test.ps1:11:10:11:12 | z | $@ | test.ps1:16:10:16:20 | Source | Source |

View File

@@ -1,14 +1,14 @@
function Foo($a) {
Sink $a # $ MISSING: hasValueFlow=1
Sink $a # $ hasValueFlow=1
}
$x = Source "1"
Foo $x
function ThreeArgs($x, $y, $z) {
Sink $x # $ MISSING: hasValueFlow=x
Sink $y # $ MISSING: hasValueFlow=y
Sink $z # $ MISSING: hasValueFlow=z
Sink $x # $ hasValueFlow=x
Sink $y # $ hasValueFlow=y
Sink $z # $ hasValueFlow=z
}
$first = Source "x"

View File

@@ -1,2 +1,7 @@
| explicit.ps1:1:1:8:2 | <uninitialized> glob_a | explicit.ps1:2:11:2:18 | glob_a |
| explicit.ps1:5:5:5:7 | a | explicit.ps1:5:5:5:7 | a |
| explicit.ps1:6:5:6:7 | b | explicit.ps1:6:5:6:7 | b |
| parameters.ps1:1:25:1:33 | <parameter> n1 | parameters.ps1:1:25:1:33 | n1 |
| parameters.ps1:1:35:1:43 | <parameter> n2 | parameters.ps1:1:35:1:43 | n2 |
| parameters.ps1:7:9:7:16 | <parameter> a | parameters.ps1:7:9:7:16 | a |
| parameters.ps1:8:9:8:16 | <parameter> b | parameters.ps1:8:9:8:16 | b |