mirror of
https://github.com/github/codeql.git
synced 2026-05-25 00:27:09 +02:00
Merge pull request #115 from microsoft/powershell-fix-dead-end-for-stmt
Powershell fix dead end for stmt
This commit is contained in:
@@ -343,7 +343,16 @@ module Trees {
|
||||
final override predicate succ(AstNode pred, AstNode succ, Completion c) {
|
||||
// Start with initialization
|
||||
this = pred and
|
||||
first(super.getInitializer(), succ) and
|
||||
(
|
||||
first(super.getInitializer(), succ)
|
||||
or
|
||||
not exists(super.getInitializer()) and
|
||||
first(super.getCondition(), succ)
|
||||
or
|
||||
not exists(super.getInitializer()) and
|
||||
not exists(super.getCondition()) and
|
||||
first(this.getBody(), succ)
|
||||
) and
|
||||
completionIsSimple(c)
|
||||
or
|
||||
// Initialization -> condition
|
||||
@@ -359,7 +368,16 @@ module Trees {
|
||||
// Body -> iterator
|
||||
last(this.getBody(), pred, c) and
|
||||
completionIsNormal(c) and
|
||||
first(super.getIterator(), succ)
|
||||
(
|
||||
first(super.getIterator(), succ)
|
||||
or
|
||||
not exists(super.getIterator()) and
|
||||
first(super.getCondition(), succ)
|
||||
or
|
||||
not exists(super.getIterator()) and
|
||||
not exists(super.getCondition()) and
|
||||
first(this.getBody(), succ)
|
||||
)
|
||||
or
|
||||
// Iterator -> condition
|
||||
last(super.getIterator(), pred, c) and
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,2 @@
|
||||
/**
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import semmle.code.powershell.Cfg
|
||||
|
||||
import semmle.code.powershell.controlflow.internal.ControlFlowGraphImpl::TestOutput<CfgNode>
|
||||
|
||||
Reference in New Issue
Block a user