File tree Expand file tree Collapse file tree
powershell/ql/lib/semmle/code/powershell/controlflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -284,6 +284,26 @@ class ProcessBlockCfgNode extends NamedBlockCfgNode {
284284 ScriptBlockCfgNode getScriptBlock ( ) { result .getProcessBlock ( ) = this }
285285}
286286
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+
287307module ExprNodes {
288308 private class ArrayExprChildMapping extends ExprChildMapping , ArrayExpr {
289309 override predicate relevantChild ( Ast child ) {
@@ -747,7 +767,7 @@ module ExprNodes {
747767
748768 ExprCfgNode getAnKey ( ) { result = this .getKey ( _) }
749769
750- ExprCfgNode getValue ( int i ) { e .hasCfgChild ( e .getKey ( i ) , this , result ) }
770+ ExprCfgNode getValue ( int i ) { e .hasCfgChild ( e .getValue ( i ) , this , result ) }
751771
752772 ExprCfgNode getValueFromKey ( ExprCfgNode key ) {
753773 exists ( int i |
You can’t perform that action at this time.
0 commit comments