File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
python/ql/test/experimental/dataflow/typetracking Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -158,3 +158,27 @@ def test_long_import_chain_full_path():
158158 from foo .bar import baz # $ tracked_foo_bar_baz
159159 x = baz # $ tracked_foo_bar_baz
160160 do_stuff (x ) # $ tracked_foo_bar_baz
161+
162+ # ------------------------------------------------------------------------------
163+ # Global variable to method body flow
164+ # ------------------------------------------------------------------------------
165+
166+ some_value = get_tracked () # $ tracked
167+ other_value = get_tracked () # $ tracked
168+ print (some_value ) # $ tracked
169+ print (other_value ) # $ tracked
170+
171+ class MyClass (object ):
172+ # Since we define some_value method on the class, flow for some_value gets blocked
173+ # into the methods
174+ def some_value (self ):
175+ print (some_value ) # $ MISSING: tracked
176+ print (other_value ) # $ tracked
177+
178+ def other_name (self ):
179+ print (some_value ) # $ MISSING: tracked
180+ print (other_value ) # $ tracked
181+
182+ def with_global_modifier (self ):
183+ global some_value
184+ print (some_value ) # $ tracked
You can’t perform that action at this time.
0 commit comments