File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
python/ql/test/experimental/dataflow/coverage Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -534,3 +534,40 @@ def f6(arg):
534534
535535 x = f6 (SOURCE )
536536 SINK (x ) # Flow missing
537+
538+
539+ def test_dynamic_tuple_creation_1 ():
540+ tup = tuple ()
541+ tup += (SOURCE ,)
542+ tup += (NONSOURCE ,)
543+
544+ SINK (tup [0 ]) # Flow missing
545+ SINK_F (tup [1 ])
546+
547+
548+ def test_dynamic_tuple_creation_2 ():
549+ tup = ()
550+ tup += (SOURCE ,)
551+ tup += (NONSOURCE ,)
552+
553+ SINK (tup [0 ]) # Flow missing
554+ SINK_F (tup [1 ])
555+
556+
557+ def test_dynamic_tuple_creation_3 ():
558+ tup1 = (SOURCE ,)
559+ tup2 = (NONSOURCE ,)
560+ tup = tup1 + tup2
561+
562+ SINK (tup [0 ]) # Flow missing
563+ SINK_F (tup [1 ])
564+
565+
566+ # Inspired by FP-report https://github.com/github/codeql/issues/4239
567+ def test_dynamic_tuple_creation_4 ():
568+ tup = ()
569+ for item in [SOURCE , NONSOURCE ]:
570+ tup += (item ,)
571+
572+ SINK (tup [0 ]) # Flow missing
573+ SINK_F (tup [1 ])
You can’t perform that action at this time.
0 commit comments