File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed
python/ql/test/experimental/dataflow Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -726,15 +726,15 @@ def f6(arg):
726
726
return f5 (arg )
727
727
728
728
x = f6 (SOURCE )
729
- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
729
+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
730
730
x = f5 (SOURCE )
731
- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
731
+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
732
732
x = f4 (SOURCE )
733
- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
733
+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
734
734
x = f3 (SOURCE )
735
- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
735
+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
736
736
x = f2 (SOURCE )
737
- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
737
+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
738
738
x = f1 (SOURCE )
739
739
SINK (x ) #$ flow="SOURCE, l:-1 -> x"
740
740
Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ module_attr_tracker
6
6
| import_as_attr.py:1:28:1:35 | GSSA Variable attr_ref |
7
7
| import_as_attr.py:3:1:3:1 | GSSA Variable x |
8
8
| import_as_attr.py:3:5:3:12 | ControlFlowNode for attr_ref |
9
+ | import_as_attr.py:5:1:5:10 | GSSA Variable attr_ref |
9
10
| import_as_attr.py:6:5:6:5 | SSA variable y |
10
11
| import_as_attr.py:6:9:6:16 | ControlFlowNode for attr_ref |
Original file line number Diff line number Diff line change @@ -60,10 +60,10 @@ def test_import():
60
60
def to_inner_scope ():
61
61
x = tracked # $tracked
62
62
def foo ():
63
- y = x # $ MISSING: tracked
64
- return y # $ MISSING: tracked
65
- also_x = foo () # $ MISSING: tracked
66
- print (also_x ) # $ MISSING: tracked
63
+ y = x # $ tracked
64
+ return y # $ tracked
65
+ also_x = foo () # $ tracked
66
+ print (also_x ) # $ tracked
67
67
68
68
# ------------------------------------------------------------------------------
69
69
# Function decorator
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ class TrackedTest extends InlineExpectationsTest {
24
24
tracked ( t ) .flowsTo ( e ) and
25
25
// Module variables have no sensible location, and hence can't be annotated.
26
26
not e instanceof DataFlow:: ModuleVariableNode and
27
+ // Global variables on line 0 also cannot be annotated
28
+ not e .getLocation ( ) .getStartLine ( ) = 0 and
29
+ // We do not wish to annotate scope entry definitions,
30
+ // as they do not appear in the source code.
31
+ not e .asVar ( ) instanceof ScopeEntryDefinition and
27
32
tag = "tracked" and
28
33
location = e .getLocation ( ) and
29
34
value = t .getAttr ( ) and
You can’t perform that action at this time.
0 commit comments