File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
powershell/ql/lib/semmle/code/powershell Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -53,5 +53,13 @@ class If extends Expr, TIf {
53
53
)
54
54
}
55
55
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
+
56
64
predicate hasElse ( ) { exists ( this .getElse ( ) ) }
57
65
}
Original file line number Diff line number Diff line change @@ -900,6 +900,16 @@ module ExprNodes {
900
900
StmtCfgNode getAThen ( ) { result = this .getThen ( _) }
901
901
902
902
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 ( _) }
903
913
}
904
914
905
915
private class LiteralChildMapping extends ExprChildMapping , Literal {
You can’t perform that action at this time.
0 commit comments