Commit Graph

58320 Commits

Author SHA1 Message Date
Chuan-kai Lin
d8fb875bbb Merge pull request #14214 from github/cklin/pick-js-fix-2.14.5
Cherry pick "fix out of bounds string access in isUsingDecl" into 2.14.5
codeql-cli/v2.14.5
2023-09-13 14:21:47 -07:00
erik-krogh
cc3a76f7f5 fix out of bounds string access in isUsingDecl 2023-09-13 14:16:02 -07:00
Chuan-kai Lin
1a575ef297 Merge pull request #14167 from asgerf/ts/tolerate-out-of-order-requests
JS: tolerate out of order requests in TypeScript extractor
codeql-cli/v2.14.4
2023-09-08 12:33:44 -07:00
Robert Marsh
e1ffc8d886 Merge pull request #14171 from MathiasVP/fix-dataflow-out-of-post-update-nodes
C++: Fix dataflow out of post update nodes
2023-09-08 14:56:41 -04:00
Mathias Vorreiter Pedersen
9f89c63771 C++: Accept test changes. 2023-09-08 17:07:26 +01:00
Mathias Vorreiter Pedersen
0be61be07a C++: Handle flow out of post-update nodes when there's another use of the variable in the call that we need to skip. 2023-09-08 17:07:26 +01:00
Mathias Vorreiter Pedersen
d5442ec9c5 C++: Add regression test. 2023-09-08 13:10:04 +01:00
Tom Hvitved
354a55c735 Merge pull request #14169 from hvitved/backport-fix
Revert "C#: Bump all dependencies"
2023-09-08 13:37:12 +02:00
Tom Hvitved
e6a6a7931b Revert "C#: Bump all dependencies" 2023-09-08 11:19:00 +02:00
Asger F
ea384b340a JS: Change note 2023-09-08 10:31:04 +02:00
Asger F
e08a873829 JS: Tolerate TypeScript files being requested out of order 2023-09-08 10:31:04 +02:00
Chuan-kai Lin
163252d5f6 Merge pull request #14147 from github/release-prep/2.14.4
Release preparation for version 2.14.4
2023-09-05 13:50:45 -07:00
github-actions[bot]
abf2b12b1c Release preparation for version 2.14.4 2023-09-05 16:56:14 +00:00
Ian Lynagh
a2659eecfb Merge pull request #14018 from igfoo/igfoo/extractor_information_kotlin1
Kotlin: Write usesK2 ("uses Kotlin 2") information to the database
2023-09-04 13:38:23 +01:00
Michael B. Gale
77369a09a4 Merge pull request #13872 from Kwstubbs/Kevin_error_sanitizer
Go: Add sanitizer to remove paths passing through http.Error
2023-09-04 13:25:55 +01:00
Ian Lynagh
03ad04bc8e Merge pull request #14118 from igfoo/igfoo/kotlin_master
Kotlin: Make it possible to build with master
2023-09-04 12:12:25 +01:00
AlexDenisov
e2602fbbc4 Merge pull request #14119 from github/alexdenisov/sequence-expr
Swift: fix SequenceExpr extraction
2023-09-04 12:29:07 +02:00
Paolo Tranquilli
7d89028688 Merge pull request #14106 from github/alexdenisov/rename-xcode-autobuilder
Swift: rename autobuilder. NFC
2023-09-04 12:28:47 +02:00
Ian Lynagh
bbf441f87a Kotlin: Add an integration test for Kotlin 2 2023-09-04 11:28:31 +01:00
Alex Denisov
888dd786b4 Swift: fix SequenceExpr extraction
Before we extracted all the subexpressions from the `SequenceExpr` while we should've only extracted the expressions at odd indices:
```
...
/// SequenceExpr - A list of binary operations which has not yet been
/// folded into a tree.  The operands all have even indices, while the
/// subexpressions with odd indices are all (potentially overloaded)
/// references to binary operators.
class SequenceExpr final : public Expr,
...
```

The AST for a `SequenceExpr` looks like this:

```
sequence_expr:
  unresolved_dot_expr:
    ...
  assign_expr:
    member_ref_expr:
      ...
    dot_syntax_call_expr:
      ...
  unresolved_member_chain_expr:
    ...
```

however, what's is not visible with the "final" AST is that `unresolved_dot_expr` is the unresolved version of `assign_expr.member_ref_expr` and the `unresolved_member_chain_expr` is the unresolved version of `assign_expr.dot_syntax_call_expr`.
This becomes visible when I enable typechecker debugging:

```c++
auto &typeCheckerOptions = invocation.getTypeCheckerOptions();
typeCheckerOptions.DebugConstraintSolver = true;
```

Which prints the following snippets:

```
---Initial constraints for the given expression---
(assign_expr type='()' location=foo.swift:25:54 range=[foo.swift:25:13 - line:25:57]
  (unresolved_dot_expr type='$T2' location=foo.swift:25:29 range=[foo.swift:25:13 - line:25:29] field 'preferredDatePickerStyle' function_ref=unapplied
    (unresolved_dot_expr type='$T1' location=foo.swift:25:18 range=[foo.swift:25:13 - line:25:18] field 'datePicker' function_ref=unapplied
      (declref_expr type='DatePickerCell' location=foo.swift:25:13 range=[foo.swift:25:13 - line:25:13] decl=foo.(file).DatePickerRowProtocol extension.configurePickerStyle(_:_:).cell@foo.swift:15:33 function_ref=unapplied)))
  (unresolved_member_chain_expr implicit type='$T5' location=foo.swift:25:57 range=[foo.swift:25:56 - line:25:57]
    (unresolved_member_expr type='$T4' location=foo.swift:25:57 range=[foo.swift:25:56 - line:25:57] name='wheels' function_ref=unapplied)))

// ...

---Type-checked expression---
(assign_expr type='()' location=foo.swift:25:54 range=[foo.swift:25:13 - line:25:57]
  (member_ref_expr type='@lvalue UIDatePickerStyle' location=foo.swift:25:29 range=[foo.swift:25:13 - line:25:29] decl=UIKit.(file).UIDatePicker.preferredDatePickerStyle
    (force_value_expr implicit type='UIDatePicker' location=foo.swift:25:18 range=[foo.swift:25:13 - line:25:18] implicit_iuo_unwrap
      (load_expr implicit type='UIDatePicker?' location=foo.swift:25:18 range=[foo.swift:25:13 - line:25:18]
        (member_ref_expr type='@lvalue UIDatePicker?' location=foo.swift:25:18 range=[foo.swift:25:13 - line:25:18] decl=foo.(file).DatePickerCell.datePicker@foo.swift:10:29
          (declref_expr type='DatePickerCell' location=foo.swift:25:13 range=[foo.swift:25:13 - line:25:13] decl=foo.(file).DatePickerRowProtocol extension.configurePickerStyle(_:_:).cell@foo.swift:15:33 function_ref=unapplied)))))
  (dot_syntax_call_expr type='UIDatePickerStyle' location=foo.swift:25:57 range=[foo.swift:25:56 - line:25:57]
    (declref_expr type='(UIDatePickerStyle.Type) -> UIDatePickerStyle' location=foo.swift:25:57 range=[foo.swift:25:57 - line:25:57] decl=UIKit.(file).UIDatePickerStyle.wheels function_ref=unapplied)
    (argument_list implicit
      (argument
        (type_expr implicit type='UIDatePickerStyle.Type' location=foo.swift:25:56 range=[foo.swift:25:56 - line:25:56] typerepr='UIDatePickerStyle')))))
```

The proposed solution is to only extract subexpressions at indices from `SequenceExpr` thus ignoring all the unresolved leftovers.

Note: I'm not entirely sure about the case when there is only child (`elements.size() == 1`) so I'm always extracting it.

This patch fixes the last source of unresolved expressions.
2023-09-04 11:42:12 +02:00
Rasmus Wriedt Larsen
a58c9e91ea Merge pull request #14130 from RasmusWL/fixup-accept-ci-changes
Misc: Fixup for `accept-expected-changes-from-ci.py`
2023-09-04 09:47:31 +02:00
Rasmus Wriedt Larsen
301133ad94 Misc: Fixup for accept-expected-changes-from-ci.py
Allow empty lines while looking for diff (between `---expected` and `FAILED`). This can happen when there is `Locations outside the test directory` since an empty line is printed after that warning message (this output can be interleaved with the diff due to parallel execution).
2023-09-04 09:32:06 +02:00
Erik Krogh Kristensen
284ca5e4ee Merge pull request #14129 from github/dependabot/cargo/ql/regex-1.9.5
Bump regex from 1.9.3 to 1.9.5 in /ql
2023-09-04 08:11:51 +02:00
dependabot[bot]
4919cc4c4e Bump regex from 1.9.3 to 1.9.5 in /ql
Bumps [regex](https://github.com/rust-lang/regex) from 1.9.3 to 1.9.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.9.3...1.9.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 03:47:05 +00:00
Ian Lynagh
181594badb Kotlin: Add packageFqName and IrSymbolInternals compatibility
In master, we need to switch to these, but for building for older
versions we need to add our own support.

Currently the v_1_9_255 files are nto used, but we will need them (in a
differently-named directory) for a future release.
2023-09-01 11:20:58 +01:00
Ian Lynagh
72e08a9277 Kotlin: Tweak the build system
You can now make a versions/* directory that the build system doesn't
know about. This can be used to add support for not-yet-supported
versions.
2023-09-01 11:08:54 +01:00
Mathias Vorreiter Pedersen
67a0112fcb Merge pull request #14115 from MathiasVP/fix-incorrect-load-of-constant
C++: Don't generate `Load`s for constant expressions
2023-09-01 08:50:44 +01:00
Mathias Vorreiter Pedersen
72d9812fea C++: Accept more test changes. 2023-08-31 21:56:35 +01:00
Mathias Vorreiter Pedersen
dfefd62089 C++: Accept test changes. 2023-08-31 20:38:46 +01:00
Mathias Vorreiter Pedersen
aed14f2924 C++: Don't insert loads for constants. 2023-08-31 20:38:40 +01:00
Mathias Vorreiter Pedersen
b575747357 C++: Add testcase with invalid IR. 2023-08-31 20:35:33 +01:00
yoff
da64ea40b9 Merge pull request #13782 from jorgectf/jorgectf/shlex-quote
Python: Add `shlex.quote` as `py/shell-command-constructed-from-input` sanitizer
2023-08-31 21:08:58 +02:00
Ian Lynagh
eb59bc04cd Kotlin: Add missing imports 2023-08-31 19:28:05 +01:00
Ian Lynagh
3009f40814 Kotlin: Opt in to org.jetbrains.kotlin.ir.symbols.IrSymbolInternals
Needed for upstream master.
2023-08-31 19:28:05 +01:00
Ian Lynagh
1ec29bffbb Kotlin: Don't use deprecated createBlockBody
The function that takes a list of statements is hidden in upstream
master.
2023-08-31 19:28:05 +01:00
Ian Lynagh
d511d46cde Kotlin: Use packageFqName rather than fqName
Upstream master says:
   error: using 'fqName: FqName' is an error. Please use `packageFqName` instead
2023-08-31 19:28:05 +01:00
Mathias Vorreiter Pedersen
10548b57d7 Merge pull request #14103 from MathiasVP/non-certain-def-is-a-use
C++: Non-certain definitions should always be uses
2023-08-31 16:15:30 +01:00
Erik Krogh Kristensen
cd590d356d Merge pull request #14053 from erik-krogh/ts52
JS: Add support for TypeScript 5.2
2023-08-31 14:39:50 +02:00
Tom Hvitved
23857267db Merge pull request #14110 from hvitved/ruby/remove-emptiness-successor
Ruby: Get rid of unused `EmptinessSuccessor`
2023-08-31 13:41:25 +02:00
Tom Hvitved
50db6916c8 Ruby: Get rid of unused EmptinessSuccessor 2023-08-31 13:17:05 +02:00
Tom Hvitved
73370e7282 Merge pull request #14100 from hvitved/dataflow/consistency-pack
Data flow: Add consistency checks to shared ql pack
2023-08-31 11:47:40 +02:00
Tom Hvitved
756886808d Merge pull request #14098 from hvitved/csharp/cil-best-impl
C#: Speedup `bestImplementation`
2023-08-31 10:57:28 +02:00
Mathias Vorreiter Pedersen
f5509da4bb Merge pull request #14038 from alexet/delete-ir
CPP: Add delete/delete[] calls to the IR.
2023-08-31 09:22:34 +01:00
Asger F
2d5c40db31 Merge pull request #14048 from asgerf/shared/variable-capture-write-source-node
Variable capture: allow arbitrary data-flow nodes to be the source of a write
2023-08-31 10:20:48 +02:00
Tom Hvitved
c68d0bc936 Merge pull request #14099 from hvitved/csharp/transitive-capture-call-unique
C#: Do not embed target callable in `TransitiveCapturedCall`
2023-08-31 10:12:26 +02:00
Alex Denisov
c1da2dfa73 Swift: fix autobuild.sh 2023-08-31 09:40:13 +02:00
Michael Nebel
ded49015e0 Merge pull request #13970 from michaelnebel/csharp/usereferenceassemlblies
C#: Compile against the reference assemblies in the standalone extractor (if possible)
2023-08-31 09:00:30 +02:00
Erik Krogh Kristensen
cd289f8207 Merge pull request #14105 from github/dependabot/cargo/ql/chrono-0.4.28
Bump chrono from 0.4.27 to 0.4.28 in /ql
2023-08-31 08:16:42 +02:00
Alex Denisov
803adae9c6 Swift: rename autobuilder. NFC 2023-08-31 08:12:52 +02:00
dependabot[bot]
4770eb0328 Bump chrono from 0.4.27 to 0.4.28 in /ql
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.27 to 0.4.28.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.27...v0.4.28)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-31 03:44:01 +00:00