@@ -54,15 +54,15 @@ module Connection {
54
54
}
55
55
56
56
/** Gets a reference to an instance of `db.Connection`. */
57
- private DataFlow:: Node instance ( DataFlow:: TypeTracker t ) {
57
+ private DataFlow:: LocalSourceNode instance ( DataFlow:: TypeTracker t ) {
58
58
t .start ( ) and
59
59
result instanceof InstanceSource
60
60
or
61
61
exists ( DataFlow:: TypeTracker t2 | result = instance ( t2 ) .track ( t2 , t ) )
62
62
}
63
63
64
64
/** Gets a reference to an instance of `db.Connection`. */
65
- DataFlow:: Node instance ( ) { result = instance ( DataFlow:: TypeTracker:: end ( ) ) }
65
+ DataFlow:: Node instance ( ) { instance ( DataFlow:: TypeTracker:: end ( ) ) . flowsTo ( result ) }
66
66
}
67
67
68
68
/**
@@ -71,26 +71,26 @@ module Connection {
71
71
*/
72
72
module cursor {
73
73
/** Gets a reference to the `cursor` method on a connection. */
74
- private DataFlow:: Node methodRef ( DataFlow:: TypeTracker t ) {
74
+ private DataFlow:: LocalSourceNode methodRef ( DataFlow:: TypeTracker t ) {
75
75
t .startInAttr ( "cursor" ) and
76
76
result = Connection:: instance ( )
77
77
or
78
78
exists ( DataFlow:: TypeTracker t2 | result = methodRef ( t2 ) .track ( t2 , t ) )
79
79
}
80
80
81
81
/** Gets a reference to the `cursor` method on a connection. */
82
- DataFlow:: Node methodRef ( ) { result = methodRef ( DataFlow:: TypeTracker:: end ( ) ) }
82
+ DataFlow:: Node methodRef ( ) { methodRef ( DataFlow:: TypeTracker:: end ( ) ) . flowsTo ( result ) }
83
83
84
84
/** Gets a reference to a result of calling the `cursor` method on a connection. */
85
- private DataFlow:: Node methodResult ( DataFlow:: TypeTracker t ) {
85
+ private DataFlow:: LocalSourceNode methodResult ( DataFlow:: TypeTracker t ) {
86
86
t .start ( ) and
87
87
result .asCfgNode ( ) .( CallNode ) .getFunction ( ) = methodRef ( ) .asCfgNode ( )
88
88
or
89
89
exists ( DataFlow:: TypeTracker t2 | result = methodResult ( t2 ) .track ( t2 , t ) )
90
90
}
91
91
92
92
/** Gets a reference to a result of calling the `cursor` method on a connection. */
93
- DataFlow:: Node methodResult ( ) { result = methodResult ( DataFlow:: TypeTracker:: end ( ) ) }
93
+ DataFlow:: Node methodResult ( ) { methodResult ( DataFlow:: TypeTracker:: end ( ) ) . flowsTo ( result ) }
94
94
}
95
95
96
96
/**
@@ -101,7 +101,7 @@ module cursor {
101
101
*
102
102
* See https://www.python.org/dev/peps/pep-0249/#id15.
103
103
*/
104
- private DataFlow:: Node execute ( DataFlow:: TypeTracker t ) {
104
+ private DataFlow:: LocalSourceNode execute ( DataFlow:: TypeTracker t ) {
105
105
t .startInAttr ( "execute" ) and
106
106
result in [ cursor:: methodResult ( ) , Connection:: instance ( ) ]
107
107
or
@@ -116,7 +116,7 @@ private DataFlow::Node execute(DataFlow::TypeTracker t) {
116
116
*
117
117
* See https://www.python.org/dev/peps/pep-0249/#id15.
118
118
*/
119
- DataFlow:: Node execute ( ) { result = execute ( DataFlow:: TypeTracker:: end ( ) ) }
119
+ DataFlow:: Node execute ( ) { execute ( DataFlow:: TypeTracker:: end ( ) ) . flowsTo ( result ) }
120
120
121
121
/** A call to the `execute` method on a cursor (or on a connection). */
122
122
private class ExecuteCall extends SqlExecution:: Range , DataFlow:: CallCfgNode {
0 commit comments