File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
swift/ql/lib/codeql/swift/dataflow/internal Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -155,16 +155,14 @@ private module Cached {
155
155
or
156
156
// flow through nil-coalescing operator `??`
157
157
exists ( BinaryExpr nco |
158
- nco .getFunction ( ) .( DeclRefExpr ) .getDecl ( ) .( FreeFunctionDecl ) .getName ( ) = "??(_:_:)" and
159
- (
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
158
+ nco .getStaticTarget ( ) .( FreeFunctionDecl ) .getName ( ) = "??(_:_:)" and
167
159
nodeTo .asExpr ( ) = nco
160
+ |
161
+ // value argument
162
+ nodeFrom .asExpr ( ) = nco .getAnOperand ( )
163
+ or
164
+ // unpack closure (the second argument is typically an `AutoClosureExpr` argument)
165
+ nodeFrom .asExpr ( ) = nco .getAnOperand ( ) .( AutoClosureExpr ) .getReturn ( ) .getResult ( )
168
166
)
169
167
or
170
168
// flow through ternary operator `? :`
You can’t perform that action at this time.
0 commit comments