File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
python/ql/test/library-tests/dataflow/fieldflow Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ def fields_with_local_flow(x):
146146class NestedObj (object ):
147147 def __init__ (self ):
148148 self .obj = MyObj ("OK" )
149+ self .obj .foo = "default"
149150
150151 def getObj (self ):
151152 return self .obj
@@ -163,6 +164,20 @@ def getObj(self):
163164a2 = NestedObj ()
164165a2 .getObj ().foo = x2
165166SINK (a2 .obj .foo ) # $ flow="SOURCE, l:-3 -> a2.obj.foo"
167+
168+ # Global variable
169+ app = NestedObj ()
170+
171+ def init_global ():
172+ app .obj .foo = SOURCE
173+
174+ def read_global ():
175+ return app .obj .foo
176+
177+ def test_global_nested_attributes ():
178+ init_global ()
179+ result = read_global ()
180+ SINK (result ) # $ MISSING: flow="SOURCE, l:-8 -> result"
166181
167182# ------------------------------------------------------------------------------
168183# Global scope interaction
You can’t perform that action at this time.
0 commit comments