Skip to content

Commit f467de0

Browse files
committed
PS: Drive-by improvement: Make ObjectCreationNode a CallNode.
1 parent c86c639 commit f467de0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

powershell/ql/lib/semmle/code/powershell/dataflow/internal/DataFlowPublic.qll

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,10 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
481481
*
482482
* For example, `[Foo]::new()` or `New-Object Foo`.
483483
*/
484-
class ObjectCreationNode extends ExprNode {
485-
CfgNodes::ExprNodes::ObjectCreationCfgNode objectCreation;
484+
class ObjectCreationNode extends CallNode {
485+
override CfgNodes::ExprNodes::ObjectCreationCfgNode call;
486486

487-
ObjectCreationNode() { this.getExprNode() = objectCreation }
488-
489-
final CfgNodes::ExprNodes::ObjectCreationCfgNode getObjectCreationNode() {
490-
result = objectCreation
491-
}
487+
final CfgNodes::ExprNodes::ObjectCreationCfgNode getObjectCreationNode() { result = call }
492488

493489
/**
494490
* Gets the node corresponding to the expression that decides which type
@@ -497,7 +493,7 @@ class ObjectCreationNode extends ExprNode {
497493
* For example, in `[Foo]::new()`, this would be `Foo`, and in
498494
* `New-Object Foo`, this would be `Foo`.
499495
*/
500-
Node getConstructedTypeNode() { result.asExpr() = objectCreation.getConstructedTypeExpr() }
496+
Node getConstructedTypeNode() { result.asExpr() = call.getConstructedTypeExpr() }
501497

502498
bindingset[result]
503499
pragma[inline_late]

0 commit comments

Comments
 (0)