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 =
150150 TBuiltinTuple ( Builtin bltn ) { bltn .getClass ( ) = Builtin:: special ( "tuple" ) } or
151151 /** Represents a tuple in the Python source */
152152 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+ )
155157 } or
156158 /** Varargs tuple */
157159 TVarargsTuple ( CallNode call , PointsToContext context , int offset , int length ) {
@@ -201,6 +203,13 @@ newtype TObject =
201203 Expressions:: subscriptPartsPointsTo ( _, _, generic , index )
202204 }
203205
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+
204213/** Holds if the object `t` is a type. */
205214predicate isType ( ObjectInternal t ) {
206215 t .isClass ( ) = true
You can’t perform that action at this time.
0 commit comments