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 {
940940abstract class ReturningNode extends Node {
941941 /** Gets the kind of this return node. */
942942 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+ }
943949}
944950
945951/** A data-flow node that represents a value returned by a callable. */
@@ -1060,10 +1066,8 @@ private module ReturnNodes {
10601066 SynthReturnNode ( ) { this = TSynthReturnNode ( scope , kind ) }
10611067
10621068 /** 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 ) }
10671071
10681072 override ReturnKind getKind ( ) { result = kind }
10691073
Original file line number Diff line number Diff line change @@ -80,10 +80,8 @@ predicate jumpStep = DataFlowPrivate::jumpStep/2;
8080pragma [ nomagic]
8181private predicate flowThrough ( DataFlowPublic:: ParameterNode param ) {
8282 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 ( ) )
8785 |
8886 rk instanceof DataFlowDispatch:: NormalReturnKind
8987 or
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ getTarget
153153| calls.rb:383:1:383:23 | call to instance | calls.rb:326:5:328:7 | instance |
154154| calls.rb:383:1:383:23 | call to instance | calls.rb:336:5:338:7 | instance |
155155| 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 |
156157| calls.rb:388:13:388:48 | call to puts | calls.rb:102:5:102:30 | puts |
157158| calls.rb:392:13:392:22 | call to singleton1 | calls.rb:387:9:389:11 | singleton1 |
158159| 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