We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2dbb891 commit 52d5578Copy full SHA for 52d5578
swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPrivate.qll
@@ -156,7 +156,14 @@ private module Cached {
156
// flow through nil-coalescing operator `??`
157
exists(BinaryExpr nco |
158
nco.getFunction().(DeclRefExpr).getDecl().(FreeFunctionDecl).getName() = "??(_:_:)" and
159
- nodeFrom.asExpr() = nco.getAnOperand() and
+ (
160
+ // value argument
161
+ nodeFrom.asExpr() = nco.getAnOperand()
162
+ or
163
+ // unpack closure (the second argument is typically an `AutoClosureExpr` argument)
164
+ nodeFrom.asExpr() =
165
+ nco.getAnOperand().(AbstractClosureExpr).getBody().getAnElement().(ReturnStmt).getResult()
166
+ ) and
167
nodeTo.asExpr() = nco
168
)
169
or
0 commit comments