File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
powershell/ql/lib/semmle/code/powershell/controlflow Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,26 @@ class ProcessBlockCfgNode extends NamedBlockCfgNode {
284
284
ScriptBlockCfgNode getScriptBlock ( ) { result .getProcessBlock ( ) = this }
285
285
}
286
286
287
+ private class CatchClauseChildMapping extends NonExprChildMapping , CatchClause {
288
+ override predicate relevantChild ( Ast child ) {
289
+ child = this .getBody ( ) or child = this .getACatchType ( )
290
+ }
291
+ }
292
+
293
+ class CatchClauseCfgNode extends AstCfgNode {
294
+ override string getAPrimaryQlClass ( ) { result = "CatchClauseCfgNode" }
295
+
296
+ CatchClauseChildMapping s ;
297
+
298
+ CatchClause getCatchClause ( ) { result = s }
299
+
300
+ StmtCfgNode getBody ( ) { s .hasCfgChild ( s .getBody ( ) , this , result ) }
301
+
302
+ TypeConstraint getCatchType ( int i ) { result = s .getCatchType ( i ) }
303
+
304
+ TypeConstraint getACatchType ( ) { result = this .getCatchType ( _) }
305
+ }
306
+
287
307
module ExprNodes {
288
308
private class ArrayExprChildMapping extends ExprChildMapping , ArrayExpr {
289
309
override predicate relevantChild ( Ast child ) {
@@ -747,7 +767,7 @@ module ExprNodes {
747
767
748
768
ExprCfgNode getAnKey ( ) { result = this .getKey ( _) }
749
769
750
- ExprCfgNode getValue ( int i ) { e .hasCfgChild ( e .getKey ( i ) , this , result ) }
770
+ ExprCfgNode getValue ( int i ) { e .hasCfgChild ( e .getValue ( i ) , this , result ) }
751
771
752
772
ExprCfgNode getValueFromKey ( ExprCfgNode key ) {
753
773
exists ( int i |
You can’t perform that action at this time.
0 commit comments