File tree Expand file tree Collapse file tree 2 files changed +11
-17
lines changed
lib/codeql/swift/elements/expr
test/library-tests/elements/expr/logicaloperation Expand file tree Collapse file tree 2 files changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -6,31 +6,19 @@ private import codeql.swift.elements.expr.DeclRefExpr
66private import codeql.swift.elements.decl.ConcreteFuncDecl
77
88private predicate unaryHasName ( PrefixUnaryExpr e , string name ) {
9- e .getFunction ( )
10- .( DotSyntaxCallExpr )
11- .getFunction ( )
12- .( DeclRefExpr )
13- .getDecl ( )
14- .( ConcreteFuncDecl )
15- .getName ( ) = name
9+ e .getFunction ( ) .( DotSyntaxCallExpr ) .getStaticTarget ( ) .getName ( ) = name
1610}
1711
1812private predicate binaryHasName ( BinaryExpr e , string name ) {
19- e .getFunction ( )
20- .( DotSyntaxCallExpr )
21- .getFunction ( )
22- .( DeclRefExpr )
23- .getDecl ( )
24- .( ConcreteFuncDecl )
25- .getName ( ) = name
13+ e .getFunction ( ) .( DotSyntaxCallExpr ) .getStaticTarget ( ) .getName ( ) = name
2614}
2715
2816class LogicalAndExpr extends BinaryExpr {
29- LogicalAndExpr ( ) { binaryHasName ( this , "&&" ) }
17+ LogicalAndExpr ( ) { binaryHasName ( this , "&&(_:_:) " ) }
3018}
3119
3220class LogicalOrExpr extends BinaryExpr {
33- LogicalOrExpr ( ) { binaryHasName ( this , "||" ) }
21+ LogicalOrExpr ( ) { binaryHasName ( this , "||(_:_:) " ) }
3422}
3523
3624class BinaryLogicalOperation extends BinaryExpr {
@@ -41,7 +29,7 @@ class BinaryLogicalOperation extends BinaryExpr {
4129}
4230
4331class NotExpr extends PrefixUnaryExpr {
44- NotExpr ( ) { unaryHasName ( this , "!" ) }
32+ NotExpr ( ) { unaryHasName ( this , "!(_:) " ) }
4533}
4634
4735class UnaryLogicalOperation extends PrefixUnaryExpr {
Original file line number Diff line number Diff line change 1+ | logicaloperation.swift:4:6:4:11 | ... call to &&(_:_:) ... | BinaryLogicalExpr, LogicalAndExpr |
2+ | logicaloperation.swift:5:6:5:11 | ... call to \|\|(_:_:) ... | BinaryLogicalExpr, LogicalOrExpr |
3+ | logicaloperation.swift:6:6:6:7 | call to ... | NotExpr, UnaryLogicalOperation |
4+ | logicaloperation.swift:7:6:7:21 | call to ... | NotExpr, UnaryLogicalOperation |
5+ | logicaloperation.swift:7:8:7:20 | ... call to \|\|(_:_:) ... | BinaryLogicalExpr, LogicalOrExpr |
6+ | logicaloperation.swift:7:9:7:14 | ... call to &&(_:_:) ... | BinaryLogicalExpr, LogicalAndExpr |
You can’t perform that action at this time.
0 commit comments