Skip to content

Commit 15d483d

Browse files
committed
Python: Use TypeTrackingNode in new PEP249 modeling
1 parent b649f5f commit 15d483d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/ql/src/semmle/python/frameworks/internal/PEP249Impl.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module PEP249 {
6161
}
6262

6363
/** Gets a reference to a database connection (following PEP 249). */
64-
private DataFlow::LocalSourceNode instance(DataFlow::TypeTracker t) {
64+
private DataFlow::TypeTrackingNode instance(DataFlow::TypeTracker t) {
6565
t.start() and
6666
result instanceof InstanceSource
6767
or
@@ -94,7 +94,7 @@ module PEP249 {
9494
abstract class InstanceSource extends DataFlow::LocalSourceNode { }
9595

9696
/** Gets a reference to a database cursor. */
97-
private DataFlow::LocalSourceNode instance(DataFlow::TypeTracker t) {
97+
private DataFlow::TypeTrackingNode instance(DataFlow::TypeTracker t) {
9898
t.start() and
9999
result instanceof InstanceSource
100100
or
@@ -105,7 +105,7 @@ module PEP249 {
105105
DataFlow::Node instance() { instance(DataFlow::TypeTracker::end()).flowsTo(result) }
106106

107107
/** Gets a reference to the `cursor` method on a database connection. */
108-
private DataFlow::LocalSourceNode methodRef(DataFlow::TypeTracker t) {
108+
private DataFlow::TypeTrackingNode methodRef(DataFlow::TypeTracker t) {
109109
t.startInAttr("cursor") and
110110
result = Connection::instance()
111111
or
@@ -121,7 +121,7 @@ module PEP249 {
121121
}
122122

123123
/** Gets a reference to a result of calling the `cursor` method on a database connection. */
124-
private DataFlow::LocalSourceNode methodResult(DataFlow::TypeTracker t) {
124+
private DataFlow::TypeTrackingNode methodResult(DataFlow::TypeTracker t) {
125125
t.start() and
126126
result.asCfgNode().(CallNode).getFunction() = methodRef().asCfgNode()
127127
or
@@ -146,7 +146,7 @@ module PEP249 {
146146
*
147147
* See https://www.python.org/dev/peps/pep-0249/#id15.
148148
*/
149-
private DataFlow::LocalSourceNode execute(DataFlow::TypeTracker t) {
149+
private DataFlow::TypeTrackingNode execute(DataFlow::TypeTracker t) {
150150
t.startInAttr("execute") and
151151
result in [Cursor::instance(), Connection::instance()]
152152
or

0 commit comments

Comments
 (0)