Skip to content

Commit 2eb8b1a

Browse files
committed
PS: Fix two cases where a class was overriding the relevantChild predicate without calling super. This caused missing CFG children.
1 parent 800f6dd commit 2eb8b1a

File tree

1 file changed

+5
-2
lines changed
  • powershell/ql/lib/semmle/code/powershell/controlflow

1 file changed

+5
-2
lines changed

powershell/ql/lib/semmle/code/powershell/controlflow/CfgNodes.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class AttributeBaseCfgNode extends AstCfgNode {
136136

137137
private class AttributeChildMapping extends AttributeBaseChildMapping, Attribute {
138138
override predicate relevantChild(Ast child) {
139-
this.relevantChild(child)
139+
super.relevantChild(child)
140140
or
141141
child = this.getANamedArgument()
142142
or
@@ -576,7 +576,10 @@ module ExprNodes {
576576
}
577577

578578
private class ObjectCreationChildMapping extends CallExprChildMapping instanceof ObjectCreation {
579-
override predicate relevantChild(Ast child) { child = super.getConstructedTypeExpr() }
579+
override predicate relevantChild(Ast child) {
580+
super.relevantChild(child) or
581+
child = super.getConstructedTypeExpr()
582+
}
580583
}
581584

582585
class ObjectCreationCfgNode extends CallExprCfgNode {

0 commit comments

Comments
 (0)