Commit Graph

1562 Commits

Author SHA1 Message Date
Aditya Sharad
ed73875fac Merge pull request #11747 from adityasharad/tutorial/library-pack
Tutorial: Move QL detective tutorial library into shared `codeql/tutorial` library pack
2023-01-04 08:24:53 -08:00
Geoffrey White
7ad8771b53 Merge remote-tracking branch 'upstream/main' into references 2023-01-04 10:55:24 +00:00
Aditya Sharad
9988c19a42 Merge branch 'main' into tutorial/library-pack 2023-01-03 14:08:37 -08:00
Geoffrey White
e5a74cb29c Swift: Add a reference for swift/hardcoded-key. 2023-01-03 17:27:31 +00:00
Henry Mercer
6be790929d Specify language names in extractor packs 2022-12-23 13:15:04 +00:00
Erik Krogh Kristensen
7201071084 Merge pull request #11777 from erik-krogh/use-new-cache
CI: use the new actions/cache@v3 instead of my own fork
2022-12-22 12:15:14 +01:00
Mathias Vorreiter Pedersen
b330b628e3 Merge pull request #11595 from d10c/swift/extract-mainactor
Swift: MethodRefExpr -> MethodLookupExpr
2022-12-22 10:22:33 +00:00
erik-krogh
b4dddc07f1 use the new actions/cache@v3 instead of my own fork 2022-12-21 21:10:55 +01:00
Arthur Baars
7111d950c1 Swift: add AlertSuppression.ql 2022-12-21 13:15:26 +01:00
Nora Dimitrijević
aaadf198ab Swift: fix 'ql/redundant-import' 2022-12-20 23:32:38 -05:00
Nora Dimitrijević
fbb14797b1 Merge branch 'main' into swift/extract-mainactor 2022-12-20 23:20:37 -05:00
Nora Dimitrijević
101f42ab3d Revert "Swift: silence QL-for-QL "Redundant override" FP"
This reverts commit 56a72d7c37.
2022-12-20 23:17:45 -05:00
Nora Dimitrijević
f3ebb6e03b Swift: MethodLookupExpr.getMethodRef() [codegen'd]
This refactors SelfApplyExpr.getFunction() as MethodLookupExpr().getMethodRef().

This is simpler, because we are not hiding DeclRefExprs or reinventing hidden AST resolution.
2022-12-20 23:09:02 -05:00
Nora Dimitrijević
4900e4030a Swift: MethodLookupExpr.getMethodRef() [hand-written]
This refactors SelfApplyExpr.getFunction() as MethodLookupExpr().getMethodRef().

This is simpler, because we are not hiding DeclRefExprs or reinventing hidden AST resolution.
2022-12-20 23:08:32 -05:00
Aditya Sharad
ed29b3e4d6 Shared packs: Depend on codeql/tutorial from all language libraries
This allows `import tutorial` from queries targeting
any language, just like before, while removing the
duplicate copies of `tutorial.qll`.
2022-12-19 15:52:11 -08:00
Nora Dimitrijević
1c64bf4bbc Swift: remove superfluous newline 2022-12-19 18:00:20 -05:00
Nora Dimitrijević
55c6e565f7 Swift: PrintAst.qll nodes() ordering fix not needed
No-double-parents should be sufficient for a stable top-level ordering.
2022-12-19 17:52:20 -05:00
Nora Dimitrijević
8b0da01e0d Swift: allow self./super. sinks in StaticInitializationVector
Assumption: the extra path is not an issue in practice as the body of
the cryptographic library's init methods are not normally extracted,
only the stubs in this test are.
2022-12-19 17:39:44 -05:00
Nora Dimitrijević
3da54ebc61 Swift: give a clearer name to {Self,Super}RefExpr.getMethodDecl 2022-12-19 17:33:13 -05:00
Nora Dimitrijević
56a72d7c37 Swift: silence QL-for-QL "Redundant override" FP 2022-12-19 16:45:31 -05:00
Jami
ff652f7dee Merge branch 'main' into jcogs33/model-top-jdk-apis 2022-12-16 15:32:50 -05:00
Tom Hvitved
e45edcc159 Merge pull request #11674 from hvitved/dataflow/param-context
Data flow: Track callable in flow-through pruning
2022-12-16 09:25:15 +01:00
Jami Cogswell
f01ee9e4c2 Java: remove PR-merging comment 2022-12-15 22:56:15 -05:00
Jami
fd63348549 Merge pull request #11585 from jcogs33/jcogs33/mad-metrics-query
Java: add MaD metrics query
2022-12-15 19:26:51 -05:00
Nora Dimitrijević
938f724602 Swift: fix db upgrade/downgrade script after pull 2022-12-15 16:37:52 -05:00
Mathias Vorreiter Pedersen
801f4bc8a3 Merge pull request #11715 from geoffw0/jsevalcleanup 2022-12-15 17:35:49 +00:00
Nora Dimitrijević
ea6c69dd34 Swift: fix test with different linux/macos results
`methodlookup.swift` has one more call to `Builtin.zeroInitializer()`
in macOS than it does in Linux.
2022-12-15 11:48:43 -05:00
Nora Dimitrijević
893ec33da0 Swift: update .expected for integration tests 2022-12-15 11:28:02 -05:00
Geoffrey White
9481673c07 Swift: Remove temp workaround. 2022-12-15 16:08:51 +00:00
Nora Dimitrijević
60727b1e5e Swift: Fix Builtin(Types) test extraction failure 2022-12-15 10:47:10 -05:00
Tom Hvitved
f8571dd0b6 Data flow: Work around functionality-induced misoptimization 2022-12-15 15:29:14 +01:00
Tom Hvitved
6eda042229 Data flow: Sync files 2022-12-15 15:29:13 +01:00
Geoffrey White
8e61c78ce6 Swift: Fix RemoteFlowSource performance issue. 2022-12-15 12:36:32 +00:00
Jami Cogswell
46b8fbc4c9 Java: update remaining models, resolve merge conflict 2022-12-15 00:33:06 -05:00
Nora Dimitrijević
7ea0eada11 Swift: add missing Builtin symbols 2022-12-14 20:03:41 -05:00
Nora Dimitrijević
2d288906a4 Swift: fix db downgrade script 2022-12-14 17:27:11 -05:00
Nora Dimitrijević
e16b23afc1 Swift: db upgrade/downgrade script 2022-12-14 15:56:05 -05:00
Jami
359e49044f Merge branch 'main' into jcogs33/mad-metrics-query 2022-12-14 15:33:29 -05:00
Nora Dimitrijević
8a3ef31a2c Swift: silence QL-for-QL redundant import warning 2022-12-14 15:22:39 -05:00
Nora Dimitrijević
5faa44389e Swift: Basic acceptance of UnsafeJsEval test
TODO: Fix remaining problem in a separate PR:
- path found to one async `@MainActor` evaluateJavaScript
  call, but not others. Investigate why.
- Remove duplicate paths and those with unnecessary [summary] nodes.
2022-12-14 15:02:15 -05:00
Nora Dimitrijević
95d4c304da Swift: Fix .expected tests
Only UnsafeJsEval remains.
2022-12-14 15:02:15 -05:00
Nora Dimitrijević
6269e6b24d Swift: move getName to Callable (generated)
Now that getStaticTarget returns a Callable.
2022-12-14 14:30:33 -05:00
Nora Dimitrijević
535daf39b7 Swift: move getName to Callable (hand-written)
Now that getStaticTarget returns a Callable.
2022-12-14 14:29:13 -05:00
Nora Dimitrijević
89cd082f0a Swift: {Method,Initializer}CallExpr + SelfRefExpr
Adds a bit of symmetry in the API.

Also, fix a couple of tests that were using the old types.
2022-12-14 14:28:01 -05:00
Nora Dimitrijević
5f03099000 Swift: clarify DotSyntaxBaseIgnoredExpr
- Add docstring with implementation note.
- Avoid `concat` aggregate in toString().

Still, this class should really be cleaned up in the following ways:

- Rename to a sane name at the schema level
- Have subtypes that change the return type of getSubExpr to reflect
  the structure of the desugared closure. E.g. one for methods,
  one for fields.
2022-12-14 14:28:00 -05:00
Nora Dimitrijević
16a119248d Swift: remove toString() = "call to call to ..." 2022-12-14 14:28:00 -05:00
Nora Dimitrijević
91f35a5d53 Swift: isStaticOrClassMethod + isInstanceMethod
Still, we should really be extracting these attributes.
2022-12-14 14:28:00 -05:00
Nora Dimitrijević
6a0b020573 Swift: move methodlookup test to library-tests 2022-12-14 14:28:00 -05:00
Nora Dimitrijević
15d5674d12 Swift: update .expected files based on last commit 2022-12-14 14:28:00 -05:00
Nora Dimitrijević
a620658a66 Swift: fix PrintAst order, double parents, orphan decl refs
The main problem is that a lot of the old DotSyntaxApplyExpr->MethodRefExpr
synth-constructor hacks were not fully generalized to SelfApplyExpr
and OtherConstructorDeclRefExpr.

Also:

- Gave a index-in-parent-based ordering to PrintAst nodes(), to stabilize it more.
- Use a slightly more general SelfApplyExpr->Decl conversion
2022-12-14 14:28:00 -05:00