File tree Expand file tree Collapse file tree
powershell/ql/lib/semmle/code/powershell Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,5 +53,13 @@ class If extends Expr, TIf {
5353 )
5454 }
5555
56+ StmtBlock getABranch ( boolean b ) {
57+ b = true and result = this .getAThen ( )
58+ or
59+ b = false and result = this .getElse ( )
60+ }
61+
62+ StmtBlock getABranch ( ) { result = this .getAThen ( ) or result = this .getElse ( ) }
63+
5664 predicate hasElse ( ) { exists ( this .getElse ( ) ) }
5765}
Original file line number Diff line number Diff line change @@ -900,6 +900,16 @@ module ExprNodes {
900900 StmtCfgNode getAThen ( ) { result = this .getThen ( _) }
901901
902902 StmtCfgNode getElse ( ) { e .hasCfgChild ( e .getElse ( ) , this , result ) }
903+
904+ StmtCfgNode getABranch ( boolean b ) {
905+ b = true and
906+ result = this .getAThen ( )
907+ or
908+ b = false and
909+ result = this .getElse ( )
910+ }
911+
912+ StmtCfgNode getABranch ( ) { result = this .getABranch ( _) }
903913 }
904914
905915 private class LiteralChildMapping extends ExprChildMapping , Literal {
You can’t perform that action at this time.
0 commit comments