Commit Graph

40088 Commits

Author SHA1 Message Date
Rasmus Wriedt Larsen
cceeaef6bf Merge pull request #9412 from github/RasmusWL/labeler-permissions
Misc: Set permissions for labeler Action
2022-06-03 11:36:37 +02:00
AlexDenisov
0a861ff616 Merge pull request #9410 from github/alexdenisov/swift-extract-only-primary-files
Swift: extract only primary files
2022-06-03 10:44:18 +02:00
Alex Denisov
14384b7696 Swift: switch back to references 2022-06-03 10:22:25 +02:00
Chris Smowton
04422eeaee Merge pull request #9378 from porcupineyhairs/goJwtSign
Golang : Add query to detect JWT signing vulnerabilities
2022-06-02 20:53:03 +01:00
Chris Smowton
d5ac7190cc Remove duplicate function 2022-06-02 17:02:54 +01:00
Chris Smowton
e54b29a846 Autoformat 2022-06-02 15:58:29 +01:00
Chris Smowton
602495df4c Replace cases accidentally handled by CompareExprSanitizer with ReturnedAlongsideErrorSanitizerGuard 2022-06-02 15:53:41 +01:00
Chris Smowton
70c74bfcc0 Merge pull request #9418 from smowton/smowton/admin/test-java-kotlin-map-entries
Kotlin: add test for Java and Kotlin both extending Map.Entry
2022-06-02 15:52:59 +01:00
Robert Marsh
43907b6a30 Merge pull request #9409 from github/alexdenisov/swift-fix-ctor-dtor-tostring
Swift: fix ctor/dtor names in toString
2022-06-02 10:34:03 -04:00
Chris Smowton
b48a07e7b8 Tighten up CompareExprSanitizer
- Document
- Only actually consider comparisons
- Don't sanitize literals
2022-06-02 15:18:38 +01:00
Chris Smowton
3155771abe Rename empty-string sanitizer to reflect what it actually does. 2022-06-02 15:10:02 +01:00
Chris Smowton
bfbc1d48b7 Simplify redundant sanitizer 2022-06-02 15:02:41 +01:00
Chris Smowton
3d63cec1e8 Autoformat 2022-06-02 14:45:28 +01:00
Porcupiney Hairs
361b7037c6 Include suggested changes from review. 2022-06-02 19:11:44 +05:30
AlexDenisov
2187bf5dde Merge pull request #9419 from github/revert-9373-cfg-for-key-paths
Revert "Swift: Control-flow for key paths"
2022-06-02 15:26:07 +02:00
Paolo Tranquilli
c9d109ddd3 Revert "Swift: Control-flow for key paths" 2022-06-02 14:55:52 +02:00
Chris Smowton
ebb52adba6 Kotlin: add test for Java and Kotlin both extending Map.Entry 2022-06-02 13:30:39 +01:00
Chris Smowton
8b1605a617 Merge pull request #9405 from smowton/smowton/fix/restore-wildcard-types
Kotlin: Introduce / restore implied wildcard types
2022-06-02 13:26:11 +01:00
Chris Smowton
efc534abe7 Add implied wildcards when extracting type parameter bounds
kotlinc seems to always insert wildcards where type parameter variance implies them, and ignores @JvmSuppressWildcards at least in 1.6.20.
2022-06-02 11:37:15 +01:00
Porcupiney Hairs
1ef42a11ad Include suggested changes from review. 2022-06-02 16:04:29 +05:30
Chris Smowton
c1592cb1dc Accept test changes 2022-06-02 10:31:35 +01:00
Chris Smowton
910bb51094 Extract WildcardTypeAccesses
Their absence became more noticeable now that more implicit wildcards are being produced.
2022-06-02 10:31:08 +01:00
Rasmus Wriedt Larsen
b646195d14 Misc: Set permissions for labeler Action
Like in the example on 
https://github.com/actions/labeler#create-workflow
2022-06-02 10:27:48 +02:00
Tamás Vajk
d7b06aa2ba Merge pull request #9401 from tamasvajk/kotlin-cleanup
Kotlin: Reuse `codeQlWithHasQuestionMark`
2022-06-02 10:24:17 +02:00
Anders Schack-Mulligen
7214990762 Merge pull request #9408 from github/workflow/coverage/update
Update CSV framework coverage reports
2022-06-02 10:01:15 +02:00
Mathias Vorreiter Pedersen
927aceb420 Merge pull request #9373 from MathiasVP/cfg-for-key-paths 2022-06-02 08:32:29 +01:00
Paolo Tranquilli
3b57d4830b Merge pull request #9402 from github/redsun82/swift-codegen-tweaks
Swift: merge `codegen` and `cppcodegen`
2022-06-02 09:02:47 +02:00
Paolo Tranquilli
c52d19d821 Merge pull request #9403 from redsun82/build-codeowners
CODEOWNERS: remove `BUILD.bazel` from codeql-ci-reviewers
2022-06-02 09:02:17 +02:00
Alex Denisov
6419af39f3 Swift: extract only primary files
While the (removed) comment is correct and the frontend can be called in
different modes, both `swift build` and `xcodebuild` always use
`-primary-files` when compiling Swift projects.
The other mode was present only within our test runner (`qltest.sh`), so
removing it and doing what the official build systems do simplifies our
code base.

Additionally, file archival is now a separate function/operation.
2022-06-02 08:57:03 +02:00
Alex Denisov
1dab01a31c Swift: fix ctor/dtor names in toString 2022-06-02 08:28:46 +02:00
github-actions[bot]
ab4b7d8509 Add changed framework coverage reports 2022-06-02 00:18:51 +00:00
Chris Smowton
dc7d07ff46 Extract correct implied wildcards for Java classes and @JvmSuppressWildcards-annotated entities
For Java classes this means following the structure of the underlying Java type to determine where the wildcard was really present and where the Java signature ruled it out. The annotation tracking simply means looking for @JvmSuppressWildcards on any surrounding class or function to turn off wildcard introduction by default.
2022-06-01 20:00:22 +01:00
Chris Smowton
37fce6ace9 Restore implicit wildcard types
The Kotlin compiler represents types like List<out CharSequence> internally as List<CharSequence> due to the fact that List's type parameter is covariant, and similarly Comparable<in CharSequence> where Comparable's type parameter is contravariant. However it restores use-site variance when emitting class files, so we must do the same thing for
compatability with Java code.

Note this is a partial solution because it will also add wildcards to Java .class files that *could* have a variance / wildcard but don't -- for example, a Java method could really take an invariant Comparable<CharSequence>, which is only achievable in Kotlin via the @JvmSuppressWildcards annotation. We also don't yet support
@JvmSuppressWildcards given on a surrounding class or function.
2022-06-01 19:58:40 +01:00
Paolo Tranquilli
0df8a9883a CODEOWNERS: remove BUILD.bazel from codeql-ci-reviewers 2022-06-01 17:11:20 +02:00
Paolo Tranquilli
77f7fe8dbc Swift: merge codegen and cppcodegen
Python code was simplified, and now a `--generate` option can be used
to drive what can be generated.

The extractor pack creation now will use an internally generated
dbscheme. This should be the same as the checked in one, but doing so
allows `bazel run create-extractor-pack` and `bazel run codegen` to be
run independently from one another, while previously the former had to
follow the latter in case of a schema change. This is the change that
triggered the above simplification, as in order for the two dbscheme
files to be identical, the first `// generated` line had to state the
same generator script.
2022-06-01 17:07:52 +02:00
Erik Krogh Kristensen
4b2b6fae88 Merge pull request #9395 from asgerf/js/fix-type-confusion
JS: Fix cartesian product in TypeConfusionThroughParameterTampering
2022-06-01 16:28:17 +02:00
Mathias Vorreiter Pedersen
7d962ac62b Merge pull request #9397 from MathiasVP/use-autogenerated-parent-in-cfg-library
Swift: Use the autogenerated `getParent`
2022-06-01 14:45:43 +01:00
Mathias Vorreiter Pedersen
cb7be4f8ba Merge pull request #9398 from github/redsun82/swift-getparent
Swift: simplify `GetImmediateParent.qll`
2022-06-01 14:35:20 +01:00
Mathias Vorreiter Pedersen
eabb5c7137 Swift: Respond to PR comments. 2022-06-01 14:34:22 +01:00
Paolo Tranquilli
3414028b1b Swift: simplify GetImmediateParent.qll 2022-06-01 15:01:49 +02:00
Mathias Vorreiter Pedersen
db0498e38c Swift: Use the autogenerated 'getParent' predicate in the CFG library. 2022-06-01 13:49:12 +01:00
Mathias Vorreiter Pedersen
ecce7f1f10 Merge pull request #9380 from github/redsun82/swift-getparent
Swift: generate `getParent` implementation
2022-06-01 13:48:48 +01:00
Paolo Tranquilli
6b90b2b05f Swift: add children to IsPattern 2022-06-01 14:35:58 +02:00
Paolo Tranquilli
a4f97dd67a Swift: add comment about unique in getImmediateParent 2022-06-01 14:32:59 +02:00
Paolo Tranquilli
bc0a32c26e Swift: sort import list
Also fix parent tests with updated `statements.swift` file.
2022-06-01 14:32:59 +02:00
Paolo Tranquilli
3597efb728 Swift: rename to getImmediateParent and use hidden AST 2022-06-01 14:32:58 +02:00
Paolo Tranquilli
a894ba64c4 Swift: make test run in Python 3.8 2022-06-01 14:32:58 +02:00
Paolo Tranquilli
a86d0fc8a7 Swift: move getAChild to a separate module 2022-06-01 14:32:58 +02:00
Paolo Tranquilli
946e1f498a Swift: generate getParent implementation
By explicitly marking children in the `schema.yml` file, an internal
`getAChild` predicate is implemented, that is in turn used in `AstNode`
to implement `getParent`.

This is yet to be used in the control flow library to replace the
hand-rolled implementation.

A further, more complex step is to use the same information to fully
generate the core implementation of `PrintAst` (including the
accessor string). This will be done later.

The `parent` tests use the same swift code as the extractor tests, and
this is currently enforced by `sync-files.py`. Notice that `qltest.sh`
had to be modified to deal with multiple files, which was not working
yet.
2022-06-01 14:32:58 +02:00
Ian Lynagh
6f9e9e889b Merge pull request #9396 from igfoo/igfoo/labeler
CI: Add Kotlin and Go to labeler.yml
2022-06-01 13:30:22 +01:00