Commit Graph

1630 Commits

Author SHA1 Message Date
Mathias Vorreiter Pedersen
51e3ff9d09 Merge pull request #9736 from github/redsun82/swift-fix-warnings
Swift: fix QL warnings about overriding methods
2022-06-30 11:44:44 +01:00
Alex Denisov
5d5f3f82b1 Swift: fix test case 2022-06-30 07:41:28 +02:00
Paolo Tranquilli
d00fec34c3 Merge pull request #9336 from MathiasVP/swift-decls-in-cfg
Swift: CFG for local declarations
2022-06-29 15:10:45 +02:00
Mathias Vorreiter Pedersen
e03646aba4 Merge pull request #9737 from geoffw0/arithmetic
Swift: Add ArithmeticOperation.qll library
2022-06-29 13:40:20 +01:00
Mathias Vorreiter Pedersen
f35ab7c292 Swift: Accept test changes to the cfg. These happen due to the fixes in 9e0cf62cda. 2022-06-29 12:20:07 +01:00
Geoffrey White
2cf65c7d35 Swift: Autoformat tests. 2022-06-29 11:49:21 +01:00
Mathias Vorreiter Pedersen
4356155eeb Merge branch 'main' into swift-decls-in-cfg 2022-06-29 10:03:34 +01:00
Paolo Tranquilli
296b8cb630 Merge pull request #9719 from github/redsun82/swift-enum-is-case
Swift: add EnumIsCase test
2022-06-29 09:55:20 +02:00
Geoffrey White
8a8a7ead9b Swift: Add tests for ArithmeticOperation.qll. 2022-06-28 15:34:23 +01:00
Geoffrey White
9e0cf62cda Swift: Fix + simplify LogicalOperation.qll. 2022-06-28 15:33:03 +01:00
Paolo Tranquilli
363f7a88a9 Swift: fix QL warnings about overriding methods
The `getName` in `Type.qll` was issuing a warning in other generated
classes having a `getName` from a `name` property in `schema.yml`.

To fix the possible inconsistency, `diagnostic_name` is being renamed to
`name` in the schema. Despite the scary doc comment on
`swift::Type::getString` (namely `for use in diagnostics only`), that
seems to be the right generic naming mechanism for types, and it
coincides with the name we were extracting on types with an explicit
`name` property.

In case we find a case where `Type::getString` gives something wrong,
we can probably just patch it on that specific type class.
2022-06-28 16:30:25 +02:00
Paolo Tranquilli
5c6ac2a5f2 Swift: accept test results 2022-06-28 16:15:05 +02:00
Geoffrey White
63376da90f Swift: Add tests for LogicalOperaion.qll. 2022-06-28 15:04:47 +01:00
Paolo Tranquilli
6ff45d3dbe Merge main into redsun82/swift-enum-is-case 2022-06-28 16:03:38 +02:00
Paolo Tranquilli
364085a596 Swift: add DotSyntaxCallExpr tests 2022-06-28 15:44:42 +02:00
Paolo Tranquilli
131524d867 Swift: accept test changes
These are due to the changes on `toBeTested` that include canonical
types.
2022-06-28 12:16:08 +02:00
Paolo Tranquilli
57981384df Swift: extract ProtocolComposition- and BuiltinType 2022-06-28 12:01:36 +02:00
Paolo Tranquilli
f2b589743a Swift: add possibility to collapse class hierarchy in tests 2022-06-28 12:01:36 +02:00
Paolo Tranquilli
9d97fe7f30 Swift: generalize EnumIsCaseExpr test 2022-06-27 17:22:48 +02:00
Paolo Tranquilli
7f694f3b90 Swift: add EnumIsCase test 2022-06-27 16:25:46 +02:00
Mathias Vorreiter Pedersen
41b23572f0 Merge pull request #9673 from geoffw0/stringlengthconflation2
Swift: String length conflation query
2022-06-27 10:29:09 +01:00
Paolo Tranquilli
41fb55a7a8 Swift: extract all ReferenceStorageTypes 2022-06-24 18:10:31 +02:00
Paolo Tranquilli
fd209e57cd Swift: extract InoutType 2022-06-24 17:29:46 +02:00
Paolo Tranquilli
189a47e30d Swift: extract VariadicSequenceType 2022-06-24 17:15:45 +02:00
Paolo Tranquilli
346110e8dd Swift: extract DynamicSelfType 2022-06-24 16:49:58 +02:00
Paolo Tranquilli
4281605ba7 Swift: extract existential types 2022-06-24 16:28:18 +02:00
Paolo Tranquilli
631156dbc6 Swift: extract Nested- and PrimaryArchetypeType 2022-06-24 16:28:17 +02:00
Geoffrey White
911d30bd9a Swift: Proper query message. 2022-06-23 17:12:02 +01:00
Mathias Vorreiter Pedersen
9b587843ff Merge pull request #9669 from rdmarsh2/rdmarsh2/swift/dataflow-lambda-flow
Swift: implement LambdaCall in dataflow library
2022-06-23 10:38:45 +01:00
Geoffrey White
19026e9ed5 Swift: Work around toString change. 2022-06-22 19:16:09 +01:00
Geoffrey White
da7f49155d Swift: Use dataflow. 2022-06-22 19:16:09 +01:00
Geoffrey White
28d801fde3 Swift: CWE-135 query sources and sinks. 2022-06-22 19:16:08 +01:00
Robert Marsh
42929a70e8 Swift: implement LambdaCall in dataflow library 2022-06-22 17:30:54 +00:00
Paolo Tranquilli
e25f22da26 Merge main into redsun82/swift-extraction 2022-06-22 16:54:52 +02:00
Paolo Tranquilli
1fc2bc4938 Swift: really fix tests 2022-06-22 16:15:02 +02:00
Mathias Vorreiter Pedersen
a293fd1f3e Merge pull request #9638 from geoffw0/stringlengthconflation
Swift: String length conflation tests (for CVE-2022-23625)
2022-06-22 14:39:34 +01:00
Geoffrey White
e07df0d0c8 Swift: make setters private in test. 2022-06-22 14:13:30 +01:00
Geoffrey White
f9e1e630f7 Swift: more accurate NSObject / NSString hierarchy in test. 2022-06-22 12:36:40 +01:00
Paolo Tranquilli
3ed783df7f Swift: fix tests 2022-06-22 12:14:47 +02:00
Paolo Tranquilli
1e4ac44362 Swift: some expression extractions 2022-06-21 17:31:40 +02:00
Geoffrey White
8989210995 Swift: Fix some details so that the test works. 2022-06-21 14:22:35 +01:00
Mathias Vorreiter Pedersen
e2478d1106 Swift: 'getStaticCallTarget' should also return things like 'ConstructorDecl's. 2022-06-21 09:35:56 +01:00
Mathias Vorreiter Pedersen
a1bf448e56 Swift: Accept more test changes. 2022-06-20 15:28:06 +01:00
Mathias Vorreiter Pedersen
c049988116 Swift: Accept test changes. 2022-06-20 14:57:16 +01:00
Geoffrey White
30557ebe55 Swift: Test for string length conflation query. 2022-06-20 14:38:52 +01:00
Paolo Tranquilli
95a6c5d4e5 Swift: fix emission of synthesized entities
This was temporarily broken as we were skipping full emission of all
entities without any valid location.

We now rely on `decl->getDeclContext()->getParentSourceFile()` which is
more robust.
2022-06-20 13:00:05 +02:00
Mathias Vorreiter Pedersen
12d27ec580 Swift: Modify 'toString' in 'OtherConstructorDeclRefExpr' to properly reflect that it's a reference and not a call. 2022-06-20 09:59:23 +01:00
Paolo Tranquilli
a91c94c38b Swift: temporarily disable failing test 2022-06-20 10:32:19 +02:00
Paolo Tranquilli
0957801588 Merge pull request #9521 from github/redsun82/swift-qltestgen
Swift: generated extractor tests
2022-06-15 15:39:35 +02:00
Paolo Tranquilli
78deff68a3 Swift: add generated enum tests 2022-06-15 14:50:33 +02:00