Commit Graph

4437 Commits

Author SHA1 Message Date
Geoffrey White
5a77dfb5d5 Merge pull request #12905 from geoffw0/webviewdoc
Swift: Doc review for swift/unsafe-webview-fetch
2023-04-27 11:23:53 +01:00
Geoffrey White
507bb61c3c Swift: Add missing '.' 2023-04-27 11:00:35 +01:00
Geoffrey White
c823c58e00 Swift: WebView -> web view. 2023-04-27 10:57:25 +01:00
Geoffrey White
cc8d7bff0b Update swift/ql/src/queries/Security/CWE-079/UnsafeWebViewFetch.qhelp
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
2023-04-27 10:12:13 +01:00
Nora Dimitrijević
6f804ff1e7 Swift: upgrade/downgrade scripts 2023-04-26 17:03:20 +02:00
Mathias Vorreiter Pedersen
d114388470 Swift: Implement 'isAbnormalExitType' and accept test changes. 2023-04-26 15:36:52 +01:00
Nora Dimitrijević
16fc42a53f Swift: fix formatting 2023-04-26 16:01:57 +02:00
Nora Dimitrijević
91a151ec2a Swift: update tests 2023-04-26 15:47:20 +02:00
Nora Dimitrijević
3d67970357 Swift: query library renamings 2023-04-26 15:47:20 +02:00
Nora Dimitrijević
4c0384b4f1 Swift: control flow and dataflow library renamings 2023-04-26 15:47:20 +02:00
Nora Dimitrijević
82eb0026e6 Swift: AST library renamings 2023-04-26 15:47:20 +02:00
Nora Dimitrijević
2d9295a5a4 Swift: [generated] library code changes 2023-04-26 15:47:20 +02:00
Nora Dimitrijević
90ad36ed6c Swift: update extractor 2023-04-26 15:47:19 +02:00
Nora Dimitrijević
ce1c4b88d8 Swift: rename Function hierarchy in schema.py 2023-04-26 15:31:54 +02:00
Mathias Vorreiter Pedersen
6dc6e13caa Swift: Hide 'DynamicSelfType' from the main AST. 2023-04-26 13:58:54 +01:00
Mathias Vorreiter Pedersen
11aff55a97 Swift: Add default implicit read steps when selecting PostUpdateNodes as sinks. 2023-04-26 13:58:48 +01:00
Mathias Vorreiter Pedersen
e6c8428875 Swift: Add syntax for selecting PostUpdateNodes in CSV rows. 2023-04-26 13:58:42 +01:00
Anders Schack-Mulligen
d681671356 Dataflow: Sync. 2023-04-26 14:45:07 +02:00
Anders Schack-Mulligen
74242638e2 Swift: One more expected output fix. 2023-04-26 14:10:13 +02:00
Anders Schack-Mulligen
9fe5462b1b Swift: Update more expected output. 2023-04-26 13:41:50 +02:00
Anders Schack-Mulligen
6b049cb37a Swift: Update expected output. 2023-04-26 13:15:39 +02:00
Anders Schack-Mulligen
3d01763092 Swift: Remove empty string DataFlowType in PathNode. 2023-04-26 13:10:01 +02:00
Paolo Tranquilli
9d80a43d6a Merge pull request #12500 from github/redsun82/swift-dispatcher-rework
Swift: rework fetching and dispatching
2023-04-26 09:58:19 +02:00
Geoffrey White
33a6e722f6 Swift: Add a test for UISearchTextField. 2023-04-25 23:31:20 +01:00
Geoffrey White
e16277ef43 Swift: Add source model for UITextField. 2023-04-25 23:14:24 +01:00
Geoffrey White
22507c1566 Swift: Add a test for UITextField. 2023-04-25 22:47:48 +01:00
Alexandre Boulgakov
909f40b6ea Merge pull request #12918 from github/sashabu/absl
Swift: Fix some TODOs with Abseil.
2023-04-25 14:05:12 +01:00
Geoffrey White
84ddfe9c3f Merge pull request #12919 from geoffw0/precision2
Swift: Upgrade two queries to precision high.
2023-04-25 14:04:52 +01:00
Alex Denisov
125aab8107 Swift: rework fetching and dispatching
* visiting now happens in a later stage than fetching labels. While
  fetching a list of entities to be visited is created, and then acted
  upon in actual extraction. This partially flattens the recursive
  nature of `fetchLabel` into a loop inside `SwiftVisitor::extract`.
  Recursion in `fetchLabel` will only happen on labels fetched while
  naming an entity (calling into `SwiftMangler`).
* The choice whether to name a declaration or type has been moved from
  the translators to `SwiftMangler`. Acting on this choice is contained
  in `SwiftDispatcher::createLabel`.
* The choice whether to emit a body of a declaration has been moved from
  `DeclTranslator` to the dispatcher. This choice is also contained in
  `SwiftDispatcher::createLabel`.
* The simple functionality of the `LabelStore` has been moved to the
  `SwiftDispatcher` as well.
2023-04-25 11:15:27 +02:00
Geoffrey White
0ebb06e185 Merge branch 'main' into flowsources 2023-04-25 10:08:15 +01:00
Geoffrey White
2c28fae7e3 Merge pull request #12836 from geoffw0/precision
Swift: Downgrade swift/unsafe-js-eval to precision medium.
2023-04-25 09:58:11 +01:00
Geoffrey White
b0b2d6e05f Swift: Upgrade two queries to @precision high. 2023-04-25 09:42:49 +01:00
AlexDenisov
fcbd211783 Merge pull request #12910 from github/redsun82/swift-hash-lazy-trap-names
Swift: use hashing for lazy decl trap file names
2023-04-25 09:54:46 +02:00
Alexandre Boulgakov
c88f9bf818 Swift: Use absl::StrJoin to dump arguments for logging.
This also removes the TODO about using `absl::StrJoin` to dump the environment because we can't easily get a range from a null-terminated `envp`. It also doesn't suffer from the usual awkwardness around inserting a separator *between* elements but not after the last one, so a for loop is clear enough.
2023-04-24 22:34:14 +01:00
Alexandre Boulgakov
621761b289 Swift: Use absl::bit_width to calculate TRAP label size.
It's not much cleaner due to arithmetic to convert truncating division to a ceiling, but has two advantages:
 1. It doesn't suffer from rounding issues with large TRAP labels. This is largely theoretical, but does let us handle `undefined` uniformly.
 2. It should be much faster (using LZCNT/BSR instead of floating point arithmetic). This is probably not a performance bottleneck, so *shrug*.
2023-04-24 22:31:11 +01:00
Paolo Tranquilli
14706b42fa Swift: strip parameters from lazy function decl trap names 2023-04-24 17:04:41 +02:00
Paolo Tranquilli
e84bdf5bed Swift: use hashing for lazy decl trap file names
It turns out mangled names can sometimes be too long. While this code
will eventually be replaced by our own mangling, we need to use hashing
to cut down the names.

Module and decl names are preserved in the trap file names for
debuggability.
2023-04-24 14:36:36 +02:00
Paolo Tranquilli
95ef7fb3f1 Revert "Swift: route compiler diagnostics through our log" 2023-04-24 13:57:24 +02:00
Michael Nebel
8ade7247a1 Merge pull request #12885 from michaelnebel/mergepathgraph3
Dataflow: Introduce param module for merging three path graphs.
2023-04-24 12:49:28 +02:00
Geoffrey White
1f126b60ff Swift: Touch UnsafeWebViewFetch.qhelp. 2023-04-24 09:35:32 +01:00
Paolo Tranquilli
1ed5f6ac96 Swift: flush log files on log flushing 2023-04-24 10:08:37 +02:00
Paolo Tranquilli
c04ac9c04e Swift: demote wrong assertion 2023-04-24 09:57:51 +02:00
Paolo Tranquilli
55f23ffa6f Merge branch 'main' into redsun82/swift-logging-assertions-and-prints 2023-04-21 09:18:48 +02:00
Geoffrey White
bfbd45a220 Swift: Fix CSV field sinks. 2023-04-20 18:14:34 +01:00
Geoffrey White
d317ad80e5 Swift: Convert to CSV sinks. 2023-04-20 17:53:00 +01:00
Nora Dimitrijević
1f861fda25 Merge pull request #12736 from d10c/swift/capture-flow
Swift: Closure Capture Helper APIs
2023-04-20 18:45:56 +02:00
Geoffrey White
380bf21a38 Swift: Update InsecureTLSExtensions.ql sinks to not depend on AssignExpr. 2023-04-20 17:15:48 +01:00
Geoffrey White
c1a95d57bb Swift: Add some test cases. 2023-04-20 17:15:47 +01:00
Michael Nebel
656d8d2451 Sync files. 2023-04-20 11:29:51 +02:00
Paolo Tranquilli
60c723e7cc Swift: aggregate default output directories
In case the extractor is run in isolation for debugging/testing, this
will avoid littering the current working directory with artifacts, and
instead having a single `extractor-out` directory to inspect or clean
up.

Also extractor logs have been nested into a `swift` directory, as the
log directory provided by the `codeql` cli is actually shared between
languages.
2023-04-20 09:20:11 +02:00