Swift: Permit data flow from generic arguments, rather than just pointers.

This commit is contained in:
Geoffrey White
2023-03-06 16:34:10 +00:00
parent 1e5b904514
commit 61340c4b20
2 changed files with 2 additions and 4 deletions

View File

@@ -211,9 +211,7 @@ private module Cached {
private predicate modifiable(Argument arg) {
arg.getExpr() instanceof InOutExpr
or
arg.getExpr().getType() instanceof NominalType
or
arg.getExpr().getType() instanceof PointerType
arg.getExpr().getType() instanceof NominalOrBoundGenericNominalType
}
predicate modifiableParam(ParamDecl param) {

View File

@@ -125,5 +125,5 @@ func testWritingPointerContainersInCalls(mpc: MyPointerContainer, mgpc: MyGeneri
sink(arg: mpc.ptr.pointee) // $ tainted=114
writeGenericPointerContainer(mgpc: mgpc)
sink(arg: mgpc.ptr.pointee) // $ MISSING: tainted=119
sink(arg: mgpc.ptr.pointee) // $ tainted=119
}