File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
lib/semmle/code/csharp/dataflow/internal Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ private class MyConsistencyConfiguration extends ConsistencyConfiguration {
35
35
override predicate argHasPostUpdateExclude ( ArgumentNode n ) {
36
36
n instanceof SummaryNode
37
37
or
38
- not exists ( LocalFlow:: getAPostUpdateNodeForArg ( n .asExpr ( ) ) )
38
+ not exists ( LocalFlow:: getAPostUpdateNodeForArg ( n .getControlFlowNode ( ) ) )
39
39
or
40
40
n instanceof ImplicitCapturedArgumentNode
41
41
or
@@ -46,15 +46,15 @@ private class MyConsistencyConfiguration extends ConsistencyConfiguration {
46
46
47
47
override predicate postHasUniquePreExclude ( PostUpdateNode n ) {
48
48
exists ( ControlFlow:: Nodes:: ExprNode e , ControlFlow:: Nodes:: ExprNode arg |
49
- e = LocalFlow:: getAPostUpdateNodeForArg ( arg . getExpr ( ) ) and
49
+ e = LocalFlow:: getAPostUpdateNodeForArg ( arg ) and
50
50
e != arg and
51
51
n = TExprPostUpdateNode ( e )
52
52
)
53
53
}
54
54
55
55
override predicate uniquePostUpdateExclude ( Node n ) {
56
56
exists ( ControlFlow:: Nodes:: ExprNode e , ControlFlow:: Nodes:: ExprNode arg |
57
- e = LocalFlow:: getAPostUpdateNodeForArg ( arg . getExpr ( ) ) and
57
+ e = LocalFlow:: getAPostUpdateNodeForArg ( arg ) and
58
58
e != arg and
59
59
n .asExpr ( ) = arg .getExpr ( )
60
60
)
Original file line number Diff line number Diff line change @@ -420,8 +420,9 @@ module LocalFlow {
420
420
}
421
421
422
422
/** Gets a node for which to construct a post-update node for argument `arg`. */
423
- ControlFlow:: Nodes:: ExprNode getAPostUpdateNodeForArg ( Argument arg ) {
424
- result = getALastEvalNode * ( arg .getAControlFlowNode ( ) ) and
423
+ ControlFlow:: Nodes:: ExprNode getAPostUpdateNodeForArg ( ControlFlow:: Nodes:: ExprNode arg ) {
424
+ arg .getExpr ( ) instanceof Argument and
425
+ result = getALastEvalNode * ( arg ) and
425
426
exists ( Expr e | result .getExpr ( ) = e |
426
427
exists ( Type t | t = e .stripCasts ( ) .getType ( ) |
427
428
t instanceof RefType and
@@ -1946,7 +1947,7 @@ private module PostUpdateNodes {
1946
1947
//
1947
1948
// This ensures that we get flow out of the call into both leafs (1), while still
1948
1949
// maintaining the invariant that the underlying expression is a pre-update node (2).
1949
- cfn = LocalFlow:: getAPostUpdateNodeForArg ( result .asExpr ( ) )
1950
+ cfn = LocalFlow:: getAPostUpdateNodeForArg ( result .getControlFlowNode ( ) )
1950
1951
or
1951
1952
cfn = result .getControlFlowNode ( )
1952
1953
}
You can’t perform that action at this time.
0 commit comments