Skip to content

Commit ac8adee

Browse files
asgerfCopilot
andcommitted
unified: Add test for receiver updates from getter reads
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 612c241 commit ac8adee

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎unified/ql/test/library-tests/dataflow/accessors_instance.swift‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,31 @@ func t8() {
9898
c.x = "safe" // trigger the setter
9999
sink(c.otherField) // $ hasTaintFlow=t8.1
100100
}
101+
102+
func t9() {
103+
class C {
104+
var field: String = "safe"
105+
var x: String {
106+
field = source("t9.1")
107+
return ""
108+
}
109+
}
110+
let c = C()
111+
let ignored = c.x
112+
sink(c.field) // $ MISSING: hasValueFlow=t9.1
113+
}
114+
115+
func t10() {
116+
class C {
117+
var field: String = "safe"
118+
var x: String {
119+
field = source("t10.1")
120+
return ""
121+
}
122+
123+
func method() {
124+
let ignored = x
125+
sink(field) // $ MISSING: hasValueFlow=t10.1
126+
}
127+
}
128+
}

0 commit comments

Comments
 (0)