File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
python/ql/lib/semmle/python/objects Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,10 @@ newtype TObject =
150
150
TBuiltinTuple ( Builtin bltn ) { bltn .getClass ( ) = Builtin:: special ( "tuple" ) } or
151
151
/** Represents a tuple in the Python source */
152
152
TPythonTuple ( TupleNode origin , PointsToContext context ) {
153
- origin .isLoad ( ) and
154
- context .appliesTo ( origin )
153
+ exists ( Scope s |
154
+ context .appliesToScope ( s ) and
155
+ scope_loads_tuplenode ( s , origin )
156
+ )
155
157
} or
156
158
/** Varargs tuple */
157
159
TVarargsTuple ( CallNode call , PointsToContext context , int offset , int length ) {
@@ -201,6 +203,13 @@ newtype TObject =
201
203
Expressions:: subscriptPartsPointsTo ( _, _, generic , index )
202
204
}
203
205
206
+ /** Join-order helper for TPythonTuple */
207
+ pragma [ nomagic]
208
+ private predicate scope_loads_tuplenode ( Scope s , TupleNode origin ) {
209
+ origin .isLoad ( ) and
210
+ origin .getScope ( ) = s
211
+ }
212
+
204
213
/** Holds if the object `t` is a type. */
205
214
predicate isType ( ObjectInternal t ) {
206
215
t .isClass ( ) = true
You can’t perform that action at this time.
0 commit comments