File tree Expand file tree Collapse file tree
python/ql/test/experimental/dataflow/fieldflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,3 +159,22 @@ def test_nested_obj_method():
159159 a = NestedObj ()
160160 a .getObj ().foo = x
161161 SINK (a .obj .foo ) # $ MISSING: flow
162+
163+ # ------------------------------------------------------------------------------
164+ # In global scope
165+ # ------------------------------------------------------------------------------
166+
167+ def func_defined_before ():
168+ SINK (global_obj .foo ) # $ MISSING: flow="SOURCE, l:+3 -> global_obj.foo"
169+
170+ global_obj = MyObj (NONSOURCE )
171+ global_obj .foo = SOURCE
172+ SINK (global_obj .foo ) # $ flow="SOURCE, l:-1 -> global_obj.foo"
173+
174+ def func_defined_after ():
175+ SINK (global_obj .foo ) # $ MISSING: flow="SOURCE, l:-4 -> global_obj.foo"
176+
177+ @expects (2 )
178+ def test_global_funcs ():
179+ func_defined_before ()
180+ func_defined_after ()
You can’t perform that action at this time.
0 commit comments