Commit Graph

4392 Commits

Author SHA1 Message Date
Paolo Tranquilli
8873e42cb1 Swift: removed unused date dependency 2023-05-03 16:02:26 +02:00
Mathias Vorreiter Pedersen
59e495aa31 Swift: Reorganize MaD rows and frameworks to ensure we always import all frameworks in 'ExternalFlow.qll' and 'FlowSummary.qll'. 2023-05-03 14:34:43 +01:00
Geoffrey White
02dc9be239 Swift: Fix the versions in 'examples' as well. 2023-05-03 14:31:48 +01:00
Paolo Tranquilli
1d492f89cc Merge branch 'main' into redsun82/swift-logging-assertions-and-prints 2023-05-03 15:19:08 +02:00
Paolo Tranquilli
51763d65b0 Swift: reshape a TODO into another 2023-05-03 15:18:35 +02:00
Mathias Vorreiter Pedersen
1c80175a34 Merge pull request #13009 from MathiasVP/fix-tostring-on-regex-literals
Swift: Fix TODO on regex literals's `toString`
2023-05-03 14:17:50 +01:00
Paolo Tranquilli
f461e719da Swift: fix wrong condition for log 2023-05-03 14:54:28 +02:00
Mathias Vorreiter Pedersen
af18c98028 Swift: Fix TODOs in 'FlowSummary.qll' 2023-05-03 13:48:17 +01:00
Mathias Vorreiter Pedersen
1f018d69ab Swift: Accept test changes. 2023-05-03 13:45:17 +01:00
Paolo Tranquilli
8de2f9958e Swift: add support to output JSON diagnostics
New `DIAGNOSE_ERROR` and `DIAGNOSE_CRITICAL` macros are added.

These accept an ID which should indicate a diagnostic source via
a function definition in `codeql::diagnostics`, together with the usual
format + arguments accepted by other `LOG_*` macros.

When the log is flushed, these special logs will result in an error JSON
diagnostic entry in the database.
2023-05-03 14:32:31 +02:00
Paolo Tranquilli
0ad529dff8 Swift: move logging to a common directory 2023-05-03 14:32:31 +02:00
Paolo Tranquilli
c7c12a7108 Swift: add json and date dependencies 2023-05-03 14:32:30 +02:00
Mathias Vorreiter Pedersen
9e129ac38d Swift: Fix toString on regex literals. 2023-05-03 12:09:12 +01:00
Geoffrey White
9590dde1e6 Merge branch 'main' into swiftoddsends 2023-05-03 11:13:38 +01:00
Geoffrey White
54a4b898a3 Swift: Re-run codegen. 2023-05-02 17:46:59 +01:00
Geoffrey White
a698f3fcb9 Merge branch 'main' into modernsec3 2023-05-02 17:35:08 +01:00
Geoffrey White
bb6aa11ce5 Swift: Additional test case. 2023-05-02 17:12:44 +01:00
Geoffrey White
ca50f1117e Swift: Hide locationless results in the inlineexpectations test (there's no way to make them expected). 2023-05-02 16:57:29 +01:00
Geoffrey White
664500d2e6 Swift: Fix member variable sinks in swift/hardcoded-key. 2023-05-02 11:26:21 +01:00
Geoffrey White
adbd2c467d Swift: Fix member variable sinks in swift/path-ionjection. 2023-05-02 11:26:20 +01:00
Paolo Tranquilli
c65c65557d Swift: accept string representation changes in test 2023-05-02 10:49:31 +02:00
Anders Schack-Mulligen
ca09649679 Dataflow: Forward hasLocationInfo. 2023-05-02 10:48:32 +02:00
Paolo Tranquilli
3685590a12 Swift: remove version control markers 2023-05-02 10:45:43 +02:00
Paolo Tranquilli
7adcd0d043 Swift: small tweak to visitBuiltinType 2023-05-02 10:45:43 +02:00
Paolo Tranquilli
87c73879cb Swift: add explanation to getExtensionIndex 2023-05-02 10:45:43 +02:00
Paolo Tranquilli
826d7c7dbe Swift: preload extension indexes
Finding each extension declaration separately within its parent seemed
to create an `O(n^2)` noticeable performance problem. This is solved
by preloading indexes and storing them in a map, so as to iterate
through the parent of an extension only once per parent instead of once
per extension.
2023-05-02 10:45:43 +02:00
Paolo Tranquilli
146591934a Swift: clean up SwiftMangler 2023-05-02 10:45:43 +02:00
Paolo Tranquilli
f6a6958c03 Swift: mangle ParameterizedProtocolType 2023-05-02 10:45:43 +02:00
Alex Denisov
92c20be038 Swift: change indexing for extension declarations to make them more stable 2023-05-02 10:45:42 +02:00
Alex Denisov
6c954eae3c Swift: handle isolated types 2023-05-02 10:45:42 +02:00
Paolo Tranquilli
dfbc248e78 Swift: mangle opened archetype and fix global actor 2023-05-02 10:45:42 +02:00
Paolo Tranquilli
0aed7d56c2 Swift: more mangling 2023-05-02 10:45:42 +02:00
Paolo Tranquilli
2592129d83 Swift: mangle remaining unmangled types appearing during test run 2023-05-02 10:45:42 +02:00
Paolo Tranquilli
c8ca6057d3 Swift: mangle several new things 2023-05-02 10:45:40 +02:00
Paolo Tranquilli
4ac91ea1b2 Swift: mangle function types, type paramters, metatypes, dependent member types 2023-05-02 10:39:46 +02:00
Paolo Tranquilli
dcca0278b8 Swift: add more functions to deduplication test 2023-05-02 09:54:59 +02:00
Paolo Tranquilli
ab5b267a39 Swift: add GenericFunctionType to deduplication test 2023-05-02 09:54:04 +02:00
Paolo Tranquilli
2eb82fede7 Swift: restrict Type.ql for deduplication test 2023-05-02 09:52:34 +02:00
Paolo Tranquilli
b6146478dc Swift: mangle nominal and bound generic types 2023-05-02 09:49:48 +02:00
Paolo Tranquilli
1274aaaf9c Swift: mangle GenericTypeDecl 2023-05-02 09:49:48 +02:00
Paolo Tranquilli
476cf72710 Swift: mangle AnyGenericType 2023-05-02 09:49:48 +02:00
Paolo Tranquilli
348bc964be Swift: turn current decl mangling into visitor 2023-05-02 09:49:48 +02:00
Paolo Tranquilli
b269bd5010 Swift: mangle builtin and tuple types 2023-05-02 09:49:48 +02:00
Anders Schack-Mulligen
5927bb2030 Dataflow: Replace "extends Node" with "instanceof Node". 2023-05-02 09:48:34 +02:00
Nora Dimitrijević
383b2e183d Merge pull request #12936 from d10c/swift/rename-functions
Swift: rename ugly names in the Function AST hierarchy
2023-05-01 17:08:19 +02:00
Nora Dimitrijević
c81ea9d747 Merge branch 'main' into swift/rename-functions 2023-05-01 11:03:26 +02:00
Geoffrey White
837f16c212 Swift: Address singleton set literal warning 2023-04-28 12:16:28 +01:00
Mathias Vorreiter Pedersen
e506f638fc DataFlow: Sync identical files. 2023-04-27 18:40:33 +01:00
Geoffrey White
74274e834e Swift: Add the four complete examples from the doc pages to the examples directory. 2023-04-27 16:52:00 +01:00
Geoffrey White
abb98be996 Swift: QLDoc Type.qll, TypeDecl.qll, and deprecate one of the predicates. 2023-04-27 15:12:54 +01:00