File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
test/library-tests/modules Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -940,6 +940,12 @@ private class NewCall extends DataFlowCall {
940
940
abstract class ReturningNode extends Node {
941
941
/** Gets the kind of this return node. */
942
942
abstract ReturnKind getKind ( ) ;
943
+
944
+ pragma [ nomagic]
945
+ predicate hasKind ( ReturnKind kind , CfgScope scope ) {
946
+ kind = this .getKind ( ) and
947
+ scope = this .( NodeImpl ) .getCfgScope ( )
948
+ }
943
949
}
944
950
945
951
/** A data-flow node that represents a value returned by a callable. */
@@ -1060,10 +1066,8 @@ private module ReturnNodes {
1060
1066
SynthReturnNode ( ) { this = TSynthReturnNode ( scope , kind ) }
1061
1067
1062
1068
/** Gets a syntactic return node that flows into this synthetic node. */
1063
- ReturningNode getAnInput ( ) {
1064
- result .( NodeImpl ) .getCfgScope ( ) = scope and
1065
- result .getKind ( ) = kind
1066
- }
1069
+ pragma [ nomagic]
1070
+ ReturningNode getAnInput ( ) { result .hasKind ( kind , scope ) }
1067
1071
1068
1072
override ReturnKind getKind ( ) { result = kind }
1069
1073
Original file line number Diff line number Diff line change @@ -80,10 +80,8 @@ predicate jumpStep = DataFlowPrivate::jumpStep/2;
80
80
pragma [ nomagic]
81
81
private predicate flowThrough ( DataFlowPublic:: ParameterNode param ) {
82
82
exists ( DataFlowPrivate:: ReturningNode returnNode , DataFlowDispatch:: ReturnKind rk |
83
- DataFlowPrivate:: LocalFlow:: getParameterDefNode ( param .getParameter ( ) )
84
- .( TypeTrackingNode )
85
- .flowsTo ( returnNode ) and
86
- rk = returnNode .getKind ( )
83
+ param .flowsTo ( returnNode ) and
84
+ returnNode .hasKind ( rk , param .( DataFlowPrivate:: NodeImpl ) .getCfgScope ( ) )
87
85
|
88
86
rk instanceof DataFlowDispatch:: NormalReturnKind
89
87
or
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ getTarget
153
153
| calls.rb:383:1:383:23 | call to instance | calls.rb:326:5:328:7 | instance |
154
154
| calls.rb:383:1:383:23 | call to instance | calls.rb:336:5:338:7 | instance |
155
155
| calls.rb:383:1:383:23 | call to instance | calls.rb:342:5:344:7 | instance |
156
+ | calls.rb:383:1:383:23 | call to instance | calls.rb:375:5:377:7 | instance |
156
157
| calls.rb:388:13:388:48 | call to puts | calls.rb:102:5:102:30 | puts |
157
158
| calls.rb:392:13:392:22 | call to singleton1 | calls.rb:387:9:389:11 | singleton1 |
158
159
| calls.rb:392:13:392:22 | call to singleton1 | calls.rb:422:9:424:11 | singleton1 |
You can’t perform that action at this time.
0 commit comments