@@ -24,8 +24,8 @@ func testSet(ix: Int) {
24
24
let taintedSet = Set ( [ 1 , 2 , source ( " t1 " ) ] )
25
25
sink ( arg: taintedSet) // $ tainted=t1
26
26
sink ( arg: taintedSet. randomElement ( ) !) // $ tainted=t1
27
- sink ( arg: taintedSet. min ( ) !) // $ MISSING: tainted=t1
28
- sink ( arg: taintedSet. max ( ) !) // $ MISSING: tainted=t1
27
+ sink ( arg: taintedSet. min ( ) !) // $ tainted=t1
28
+ sink ( arg: taintedSet. max ( ) !) // $ tainted=t1
29
29
sink ( arg: taintedSet. firstIndex ( of: source ( " t2 " ) ) !)
30
30
sink ( arg: taintedSet [ taintedSet. firstIndex ( of: source ( " t3 " ) ) !] ) // $ tainted=t1
31
31
sink ( arg: taintedSet. first!) // $ tainted=t1
@@ -53,52 +53,52 @@ func testSet(ix: Int) {
53
53
54
54
var set2 = Set < Int > ( )
55
55
set2. update ( with: source ( " t5 " ) )
56
- sink ( arg: set2. randomElement ( ) !) // $ MISSING: tainted=t5
56
+ sink ( arg: set2. randomElement ( ) !) // $ tainted=t5
57
57
58
58
var set3 = Set ( [ source ( " t6 " ) ] )
59
59
sink ( arg: set3. randomElement ( ) !) // $ tainted=t6
60
60
let ( inserted, previous) = set3. insert ( source ( " t7 " ) )
61
61
sink ( arg: inserted)
62
- sink ( arg: previous) // $ tainted=t6 tainted= t7
62
+ sink ( arg: previous) // $ tainted=t7
63
63
let previous2 = set3. update ( with: source ( " t8 " ) )
64
- sink ( arg: previous2!) // $ MISSING: tainted=t8
64
+ sink ( arg: previous2!) // $ tainted=t8
65
65
let previous3 = set3. remove ( source ( " t9 " ) )
66
- sink ( arg: previous3!) // $ MISSING: tainted=t9
66
+ sink ( arg: previous3!) // $ tainted=t9
67
67
let previous4 = set3. removeFirst ( )
68
- sink ( arg: previous4) // $ MISSING: tainted=t6
68
+ sink ( arg: previous4) // $ tainted=t6 tainted=t7 tainted=t8
69
69
let previous5 = set3. remove ( at: set3. firstIndex ( of: source ( " t10 " ) ) !)
70
- sink ( arg: previous5) // $ MISSING: tainted=t6
70
+ sink ( arg: previous5) // $ tainted=t6 tainted=t7 tainted=t8
71
71
72
72
sink ( arg: goodSet. union ( goodSet) . randomElement ( ) !)
73
- sink ( arg: goodSet. union ( taintedSet) . randomElement ( ) !) // $ MISSING: tainted=t1
74
- sink ( arg: taintedSet. union ( goodSet) . randomElement ( ) !) // $ MISSING: tainted=t1
75
- sink ( arg: taintedSet. union ( taintedSet) . randomElement ( ) !) // $ MISSING: tainted=t1
73
+ sink ( arg: goodSet. union ( taintedSet) . randomElement ( ) !) // $ tainted=t1
74
+ sink ( arg: taintedSet. union ( goodSet) . randomElement ( ) !) // $ tainted=t1
75
+ sink ( arg: taintedSet. union ( taintedSet) . randomElement ( ) !) // $ tainted=t1
76
76
77
77
var set4 = Set < Int > ( )
78
78
set4. formUnion ( goodSet)
79
79
sink ( arg: set4. randomElement ( ) !)
80
80
set4. formUnion ( taintedSet)
81
- sink ( arg: set4. randomElement ( ) !) // $ MISSING: tainted=t1
81
+ sink ( arg: set4. randomElement ( ) !) // $ tainted=t1
82
82
set4. formUnion ( goodSet)
83
- sink ( arg: set4. randomElement ( ) !) // $ MISSING: tainted=t1
83
+ sink ( arg: set4. randomElement ( ) !) // $ tainted=t1
84
84
85
85
sink ( arg: goodSet. intersection ( goodSet) . randomElement ( ) !)
86
86
sink ( arg: goodSet. intersection ( taintedSet) . randomElement ( ) !)
87
- sink ( arg: taintedSet. intersection ( goodSet) . randomElement ( ) !)
88
- sink ( arg: taintedSet. intersection ( taintedSet) . randomElement ( ) !) // $ MISSING: tainted=t1
87
+ sink ( arg: taintedSet. intersection ( goodSet) . randomElement ( ) !) // $ SPURIOUS: tainted=t1
88
+ sink ( arg: taintedSet. intersection ( taintedSet) . randomElement ( ) !) // $ tainted=t1
89
89
90
90
sink ( arg: goodSet. symmetricDifference ( goodSet) . randomElement ( ) !)
91
- sink ( arg: goodSet. symmetricDifference ( taintedSet) . randomElement ( ) !) // $ MISSING: tainted=t1
92
- sink ( arg: taintedSet. symmetricDifference ( goodSet) . randomElement ( ) !) // $ MISSING: tainted=t1
93
- sink ( arg: taintedSet. symmetricDifference ( taintedSet) . randomElement ( ) !) // $ MISSING: tainted=t1
91
+ sink ( arg: goodSet. symmetricDifference ( taintedSet) . randomElement ( ) !) // $ tainted=t1
92
+ sink ( arg: taintedSet. symmetricDifference ( goodSet) . randomElement ( ) !) // $ tainted=t1
93
+ sink ( arg: taintedSet. symmetricDifference ( taintedSet) . randomElement ( ) !) // $ tainted=t1
94
94
95
95
sink ( arg: goodSet. subtracting ( goodSet) . randomElement ( ) !)
96
96
sink ( arg: goodSet. subtracting ( taintedSet) . randomElement ( ) !)
97
- sink ( arg: taintedSet. subtracting ( goodSet) . randomElement ( ) !) // $ MISSING: tainted=t1
98
- sink ( arg: taintedSet. subtracting ( taintedSet) . randomElement ( ) !) // $ MISSING: tainted=t1
97
+ sink ( arg: taintedSet. subtracting ( goodSet) . randomElement ( ) !) // $ tainted=t1
98
+ sink ( arg: taintedSet. subtracting ( taintedSet) . randomElement ( ) !) // $ tainted=t1
99
99
100
- sink ( arg: taintedSet. sorted ( ) . randomElement ( ) !) // $ MISSING: tainted=t1
101
- sink ( arg: taintedSet. shuffled ( ) . randomElement ( ) !) // $ MISSING: tainted=t1
100
+ sink ( arg: taintedSet. sorted ( ) . randomElement ( ) !) // $ tainted=t1
101
+ sink ( arg: taintedSet. shuffled ( ) . randomElement ( ) !) // $ tainted=t1
102
102
103
103
sink ( arg: taintedSet. lazy [ taintedSet. firstIndex ( of: source ( " t11 " ) ) !] ) // $ tainted=t1
104
104
0 commit comments