Skip to content

Commit f7e4fb0

Browse files
committed
Swift: respond to comments on keypath reordering
1 parent 396b9e3 commit f7e4fb0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ private module Cached {
261261
nodeFrom.asPattern().(TypedPattern).getSubPattern()
262262
]
263263
or
264-
// Flow from the unique parameter of a key path expression to
265-
// the first component in the chain.
264+
// Flow from the last component in a key path chain to
265+
// the return node for the key path.
266266
exists(KeyPathExpr keyPath |
267267
nodeFrom.(KeyPathComponentNodeImpl).getComponent() = keyPath.getComponent(keyPath.getNumberOfComponents() - 1) and
268268
nodeTo.(KeyPathReturnNodeImpl).getKeyPathExpr() = keyPath
@@ -272,9 +272,6 @@ private module Cached {
272272
nodeTo.(KeyPathComponentPostUpdateNode).getComponent() = keyPath.getComponent(keyPath.getNumberOfComponents()-1) and
273273
nodeFrom.(KeyPathReturnPostUpdateNode).getKeyPathExpr() = keyPath
274274
)
275-
276-
// nodeFrom.(KeyPathComponentPostUpdateNode).getComponent() =
277-
// nodeTo.(KeyPathParameterPostUpdateNode).getComponent(0)
278275
or
279276
// Flow to the result of a keypath assignment
280277
exists(KeyPathApplicationExpr apply, AssignExpr assign |

0 commit comments

Comments
 (0)