File tree Expand file tree Collapse file tree
python/ql/test/experimental/dataflow/coverage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -591,3 +591,35 @@ def return_from_inner_scope(x):
591591
592592def test_return_from_inner_scope ():
593593 SINK (return_from_inner_scope ([])) #$ flow="SOURCE, l:-3 -> return_from_inner_scope(..)"
594+
595+
596+ # Inspired by reverse read inconsistency check
597+ def insertAtA (d ):
598+ d ["a" ] = SOURCE
599+
600+ def test_reverse_read_subscript ():
601+ d = {"a" : NONSOURCE }
602+ l = [d ]
603+ insertAtA (l [0 ])
604+ SINK (d ["a" ]) #$ MISSING:flow="SOURCE, l-6 -> d['a']""
605+
606+ def test_reverse_read_dict_arg ():
607+ d = {"a" : NONSOURCE }
608+ dd = {"d" : d }
609+ insertAtA (** dd )
610+ SINK (d ["a" ]) #$ MISSING:flow="SOURCE, l-12 -> d['a']""
611+
612+
613+ class WithA :
614+ def setA (self , v ):
615+ self .a = v
616+
617+ def __init__ (self ):
618+ self .a = ""
619+
620+
621+ def test_reverse_read_subscript_cls ():
622+ withA = WithA ()
623+ l = [withA ]
624+ l [0 ].setA (SOURCE )
625+ SINK (withA .a ) #$ MISSING:flow="SOURCE, l:-1 -> self.a"
You can’t perform that action at this time.
0 commit comments