Skip to content

Commit 61340c4

Browse files
committed
Swift: Permit data flow from generic arguments, rather than just pointers.
1 parent 1e5b904 commit 61340c4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ private module Cached {
211211
private predicate modifiable(Argument arg) {
212212
arg.getExpr() instanceof InOutExpr
213213
or
214-
arg.getExpr().getType() instanceof NominalType
215-
or
216-
arg.getExpr().getType() instanceof PointerType
214+
arg.getExpr().getType() instanceof NominalOrBoundGenericNominalType
217215
}
218216

219217
predicate modifiableParam(ParamDecl param) {

swift/ql/test/library-tests/dataflow/taint/libraries/unsafepointer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@ func testWritingPointerContainersInCalls(mpc: MyPointerContainer, mgpc: MyGeneri
125125
sink(arg: mpc.ptr.pointee) // $ tainted=114
126126

127127
writeGenericPointerContainer(mgpc: mgpc)
128-
sink(arg: mgpc.ptr.pointee) // $ MISSING: tainted=119
128+
sink(arg: mgpc.ptr.pointee) // $ tainted=119
129129
}

0 commit comments

Comments
 (0)