@@ -29,7 +29,7 @@ abstract class NodePublic extends TNode {
29
29
/**
30
30
* Gets the expression that corresponds to this node, if any.
31
31
*/
32
- ExprCfgNode asExpr ( ) { none ( ) }
32
+ final ExprCfgNode asExpr ( ) { this = TExprNode ( result ) }
33
33
34
34
/**
35
35
* Gets the parameter that corresponds to this node, if any.
@@ -39,7 +39,7 @@ abstract class NodePublic extends TNode {
39
39
/**
40
40
* Gets the pattern that corresponds to this node, if any.
41
41
*/
42
- PatCfgNode asPat ( ) { none ( ) }
42
+ final PatCfgNode asPat ( ) { this = TPatNode ( result ) }
43
43
}
44
44
45
45
abstract class Node extends NodePublic {
@@ -144,16 +144,12 @@ class ExprNode extends AstCfgFlowNode, TExprNode {
144
144
override ExprCfgNode n ;
145
145
146
146
ExprNode ( ) { this = TExprNode ( n ) }
147
-
148
- override ExprCfgNode asExpr ( ) { result = n }
149
147
}
150
148
151
149
final class PatNode extends AstCfgFlowNode , TPatNode {
152
150
override PatCfgNode n ;
153
151
154
152
PatNode ( ) { this = TPatNode ( n ) }
155
-
156
- override PatCfgNode asPat ( ) { result = n }
157
153
}
158
154
159
155
/** A data flow node that corresponds to a name node in the CFG. */
@@ -467,16 +463,13 @@ newtype TNode =
467
463
or
468
464
e =
469
465
[
470
- any ( IndexExprCfgNode i ) .getBase ( ) , any ( FieldExprCfgNode access ) .getExpr ( ) ,
471
- any ( TryExprCfgNode try ) .getExpr ( ) ,
472
- any ( PrefixExprCfgNode pe | pe .getOperatorName ( ) = "*" ) .getExpr ( ) ,
473
- any ( AwaitExprCfgNode a ) .getExpr ( ) , any ( MethodCallExprCfgNode mc ) .getReceiver ( )
466
+ any ( IndexExprCfgNode i ) .getBase ( ) , //
467
+ any ( FieldExprCfgNode access ) .getExpr ( ) , //
468
+ any ( TryExprCfgNode try ) .getExpr ( ) , //
469
+ any ( PrefixExprCfgNode pe | pe .getOperatorName ( ) = "*" ) .getExpr ( ) , //
470
+ any ( AwaitExprCfgNode a ) .getExpr ( ) , any ( MethodCallExprCfgNode mc ) .getReceiver ( ) , //
471
+ getPostUpdateReverseStep ( any ( PostUpdateNode n ) .getPreUpdateNode ( ) .asExpr ( ) , _)
474
472
]
475
- or
476
- exists ( ExprCfgNode pred |
477
- exists ( TExprPostUpdateNode ( pred ) ) and
478
- e = getPostUpdateReverseStep ( pred , _)
479
- )
480
473
} or
481
474
TReceiverNode ( MethodCallExprCfgNode mc , Boolean isPost ) or
482
475
TSsaNode ( SsaImpl:: DataFlowIntegration:: SsaNode node ) or
0 commit comments