Commit Graph

4437 Commits

Author SHA1 Message Date
Geoffrey White
1ac9d2c618 Swift: Update models with CollectionElement, value flow. 2023-08-17 18:49:19 +01:00
Geoffrey White
59e2b0482c Merge branch 'main' into closuremodels 2023-08-17 17:16:44 +01:00
Paolo Tranquilli
3de7b75853 Swift: remove uneeded include 2023-08-17 17:36:36 +02:00
Paolo Tranquilli
970b3d06be Swift: upgrade clang-formatting to 15.0.7 2023-08-17 17:24:42 +02:00
Paolo Tranquilli
7c764f3b50 Swift: use C++20 constraints and concepts to simplify code
This simplifies several instances of metaprogramming by leveraging
[constraints and concepts from C++20][1]. This:
* gets rid of `std::enable_if` by usage of `requires`, making it more
  readable and yield better compiler messages.
* uses `requires` instead of `static_assert` to enforce `TrapLabel`
  typing
* simplifies all compile-time tests for validity of a given expression
* uses some standard library concepts where possible
* generalizes and simplifies `SwiftLocationExtractor`

Notice that in order to use the `std::derived_from` concept, `virtual`
inheritance had to be added to the label tags, because diamond
inheritance is a problem otherwise. That's because
`std::derived_from<T, U>` requires that `T*` be convertible to `U*`,
which is false if there are multiple non-virtual inheritance paths from
`U` to `T`. As tags never get actually instantiated, there is no runtime
performance penalty in using `virtual` inheritance.

[1]: https://en.cppreference.com/w/cpp/language/constraints
2023-08-17 17:24:42 +02:00
Paolo Tranquilli
75cc1d8f75 Swift: fix version check macro to be lexicographic 2023-08-17 12:19:28 +02:00
Jeroen Ketema
33e8310625 Merge branch 'main' into shared-taint-tracking 2023-08-17 00:14:25 +02:00
Robert Marsh
d3cc366dc5 Swift: add QLDoc for DictionarySubscriptNode 2023-08-16 17:57:30 +00:00
Robert Marsh
3ee3eabd95 Swift: add EnumContent to clearsContent 2023-08-16 17:52:26 +00:00
Mathias Vorreiter Pedersen
b2c7c57815 Swift: Fix expected files after a semantic merge conflict. 2023-08-16 13:52:06 +01:00
Geoffrey White
4b66bada3d Swift: Model array initializers. 2023-08-16 12:13:46 +01:00
Geoffrey White
9a4410d4b7 Swift: Additional test cases for array conversions. 2023-08-16 11:53:05 +01:00
Geoffrey White
c123c3a8d8 Swift: Codegen. 2023-08-16 11:09:39 +01:00
Geoffrey White
c9e26678d0 Swift: Change notes. 2023-08-16 10:58:04 +01:00
Geoffrey White
da6c2b6c31 Swift: Add more swift/cleartext-logging sinks. 2023-08-16 10:41:02 +01:00
Geoffrey White
6a54a8bc62 Swift: QLDoc VariadicSequenceType. 2023-08-16 08:43:51 +01:00
Geoffrey White
8f2e2a6155 Swift: Fix array content sinks for swift/cleartext-logging. 2023-08-16 08:43:50 +01:00
Geoffrey White
269f0c6cb1 Swift: Flow through varargs. 2023-08-16 08:43:28 +01:00
Geoffrey White
3fe8655b6e Swift: Test data flow through varargs. 2023-08-16 08:34:32 +01:00
Geoffrey White
b4595d8b92 Swift: Model getVaList, correct NSLogv sink for swift/cleartext-logging. 2023-08-15 22:05:58 +01:00
Robert Marsh
79368c187c Swift: fixes around DictionaryContent 2023-08-15 19:34:27 +00:00
Robert Marsh
a9f5471e76 Swift: add tests for broken dictionary flow case 2023-08-15 17:58:21 +00:00
Robert Marsh
3d20897725 Merge pull request #13910 from rdmarsh2/rdmarsh2/swift/for-await-cfg
Swift: CFG test for for-try-await
2023-08-15 11:16:07 -04:00
Mathias Vorreiter Pedersen
fec9626fe7 Merge pull request #13836 from github/alexdenisov/unresolved-dot-exprs
Swift: 'ParsedSequence' lacks proper types and yields 'Unresolved' AST nodes
2023-08-15 09:14:39 +01:00
Geoffrey White
b6dc2acc71 Merge branch 'main' into typegetname 2023-08-14 10:46:14 +01:00
Robert Marsh
7053c62c41 Swift: update and sync tests 2023-08-11 18:52:37 +00:00
Robert Marsh
3f0a249aea Swift: Autoformat Dictionary.qll 2023-08-11 18:42:37 +00:00
Robert Marsh
f047161741 Swift: Change note for dictionary flow 2023-08-11 17:33:45 +00:00
Robert Marsh
653a229482 Swift: QLDoc for Dicitonary.qll 2023-08-11 17:32:29 +00:00
Robert Marsh
f5fac66627 Swift: autoformat 2023-08-11 17:31:39 +00:00
Henry Mercer
1213eba630 Merge branch 'main' into post-release-prep/codeql-cli-2.14.2 2023-08-11 13:54:55 +01:00
Robert Marsh
d3c68c773a Swift: Add Dictionary models 2023-08-10 20:53:16 +00:00
Robert Marsh
70c2ef599a Swift: collection/tuple content for dictionary flow 2023-08-10 20:52:47 +00:00
Geoffrey White
0a2e4def8e Swift: Change note. 2023-08-10 19:53:24 +01:00
Geoffrey White
4f5d7e1b6f Swift: Accept test changes. 2023-08-10 19:49:27 +01:00
Geoffrey White
936b1ced4d Swift: Add one last test case (and address a .expected change elsewhere). 2023-08-10 19:39:39 +01:00
Robert Marsh
36bdadfc36 Merge pull request #13933 from geoffw0/madtuples
Swift: Models-as-data support for tuple content
2023-08-10 14:17:45 -04:00
Geoffrey White
94a5aa450c Swift: Edit the weak sensitive data hashing examples and qhelp to encourage use of HMAC and key derivation algorithms where appropriate. 2023-08-10 18:21:25 +01:00
Geoffrey White
376479325d Swift: Model LosslessStringConvertible. 2023-08-10 09:27:05 +01:00
Geoffrey White
effe3762b8 Swift: More robust OptionalSomePattern flow. 2023-08-10 08:49:46 +01:00
Geoffrey White
aa2e79b6da Swift: Model numeric conversions. 2023-08-10 00:19:50 +01:00
Geoffrey White
e86ccf8498 Swift: Test flow through various conversions. 2023-08-09 23:05:45 +01:00
github-actions[bot]
432c21d4fb Post-release preparation for codeql-cli-2.14.2 2023-08-09 18:45:18 +00:00
Geoffrey White
c20a17e7b7 Swift: Update the consistency test .expecteted as well. 2023-08-09 15:47:28 +01:00
Geoffrey White
23f0dd5542 Swift: Support MAD tuple content flow. 2023-08-09 15:08:11 +01:00
Geoffrey White
b4b2338144 Swift: Test for MAD tuple content flow. 2023-08-09 14:41:32 +01:00
Geoffrey White
131b2b3e0c Swift: Change note. 2023-08-09 09:25:43 +01:00
Geoffrey White
09346c76e7 Swift: Add models. 2023-08-09 09:25:43 +01:00
AlexDenisov
fa729faa0a Revert "Swift: Route compiler diagnostics through our log." 2023-08-09 10:02:59 +02:00
Geoffrey White
cb6aed18f3 Swift: Add tests. 2023-08-08 22:29:53 +01:00