Commit Graph

65188 Commits

Author SHA1 Message Date
Michael B. Gale
0ad04d45a9 Disable setup-go caching 2024-02-16 17:48:12 +00:00
Michael B. Gale
25f0692e2c Go: Update expected results for TypeParamType 2024-02-16 17:33:30 +00:00
Michael B. Gale
91ed7a8d79 Go: Use 1.22 in CI 2024-02-16 17:33:23 +00:00
Ian Lynagh
8235aed01a Kotlin 2: Accept changes in library-tests/methods
Mostly location changes, and mostly improvements.

There are a couple of cases where we lose regressions, but this actually
makes those IR elements more consistent with the elements surrounding
them.
2024-02-16 17:18:49 +00:00
Pierre
c05431e08f Merge pull request #15644 from github/sitedocs/2.16.2
Generate changelogs for 2.16.2
2024-02-16 18:15:33 +01:00
Pierre
98dac7573b Generate changelogs for 2.16.2 2024-02-16 18:02:19 +01:00
Owen Mansel-Chan
22692b9d55 Simplify definition of source and improve QLDoc
This is also slightly faster to evaluate (217s instead of 228s on apache/geode on my machine).
2024-02-16 16:47:41 +00:00
Ian Lynagh
3f696c02ab Merge pull request #15641 from igfoo/igfoo/controlflow-dom
Kotlin 2: Accept changes in library-tests/controlflow/dominance
2024-02-16 16:41:41 +00:00
Benjamin Rodes
639642fb67 Formatting. 2024-02-16 11:19:02 -05:00
Benjamin Rodes
0410ed734b Adding exclusion for main's argv (I believe this and other changes were accidentally removed in prior merge with other non-const branches) 2024-02-16 11:18:06 -05:00
Benjamin Rodes
9f3dd6300f Fixing query to use path graph. 2024-02-16 11:11:48 -05:00
Paolo Tranquilli
32d6c5ac3d Javascript: fix project layout for bazel tests
On Windows, the project layout needs to match `codeql~override`, while
on POSIX we must keep on matching `ql`. We work around this by using
`*ql*` in the project layout, which matches both.
2024-02-16 17:10:20 +01:00
Paolo Tranquilli
1626344560 Merge branch 'main' into redsun82/bzlmod 2024-02-16 17:10:02 +01:00
Ian Lynagh
92009f515b Merge pull request #15640 from igfoo/igfoo/controlflow
Kotlin 2: Accept changes in library-tests/controlflow/basic
2024-02-16 16:07:48 +00:00
Ian Lynagh
f0f1b043d5 Merge pull request #15639 from igfoo/igfoo/stmts
Kotlin 2: Accept changes in library-tests/stmts
2024-02-16 16:07:34 +00:00
Mathias Vorreiter Pedersen
7ea49b6a94 Merge pull request #15637 from MathiasVP/fix-joins-in-irguards
C++: Fix joins in `controlsBlock`
2024-02-16 16:56:21 +01:00
Benjamin Rodes
aa7c677e13 Merge branch '51-2cppnon-constant-format-alter-not-const-source' into cpp-non-constant-format-as-path-query
# Conflicts:
#	cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql
2024-02-16 10:49:05 -05:00
Benjamin Rodes
c38376a264 Merge branch '51-2cppnon-constant-format-alter-not-const-source' of https://github.com/microsoft/codeql into 51-2cppnon-constant-format-alter-not-const-source 2024-02-16 10:42:04 -05:00
Mathias Vorreiter Pedersen
7c22146f46 C++: Accept query test changes. 2024-02-16 16:33:44 +01:00
Mathias Vorreiter Pedersen
096073d295 C++: Add change note. 2024-02-16 16:29:34 +01:00
Benjamin Rodes
93f2e856af Formatting update. 2024-02-16 10:28:14 -05:00
Ian Lynagh
9069218f1a Kotlin 2: Accept changes in library-tests/controlflow/dominance
Mostly location changes; also removal of a generated block:
https://youtrack.jetbrains.com/issue/KT-63781/K2-Generated-blocks-appear-in-the-IR
2024-02-16 15:18:56 +00:00
Benjamin Rodes
4a9b2d5027 Comment change. 2024-02-16 10:18:07 -05:00
Michael B. Gale
008585eeba Go: Include arguments in RunCmd error messages 2024-02-16 15:17:24 +00:00
Michael B. Gale
8886092cd0 Go: Try to ignore errors in go mod vendor calls 2024-02-16 15:15:58 +00:00
Benjamin Rodes
5b0a3dcdbe Accidental removal of an and. 2024-02-16 10:15:21 -05:00
Benjamin Rodes
95ebbb1bbd Ql alterations for cleanup as part of merge suggestions. 2024-02-16 10:13:50 -05:00
Ben Rodes
1fb7f089ca Update cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2024-02-16 10:06:34 -05:00
Ian Lynagh
a5a6020f18 Kotlin 2: Accept changes in library-tests/controlflow/basic
Mostly location changes, but also some removal of generated blocks:
https://youtrack.jetbrains.com/issue/KT-63781/K2-Generated-blocks-appear-in-the-IR
2024-02-16 14:37:10 +00:00
Jeroen Ketema
dd39fa0bde C++: Support C++20 range-based for initializers 2024-02-16 15:20:14 +01:00
Ian Lynagh
5039acba53 Kotlin 2: Accept changes in library-tests/stmts/PrintAst.expected 2024-02-16 14:17:04 +00:00
Ian Lynagh
e8b8b11434 Kotlin 2: Accept changes in library-tests/stmts/exprs.expected 2024-02-16 14:16:18 +00:00
Mathias Vorreiter Pedersen
be54a41593 C++: Accept query test changes. 2024-02-16 15:01:50 +01:00
Mathias Vorreiter Pedersen
06ff46091d C++: Fix joins in 'controlsBlock'. 2024-02-16 14:49:20 +01:00
Tamas Vajk
c68d36eb79 Remove restored framework packages when user specified framework folders 2024-02-16 14:42:39 +01:00
Ian Lynagh
d6b96c5c23 Kotlin 2: Accept loc changes in library-tests/stmts/stmts.expected 2024-02-16 13:40:44 +00:00
Anders Schack-Mulligen
53801e8efb Dataflow: Bugfix for field reads in SimpleGlobal. 2024-02-16 14:00:04 +01:00
Mathias Vorreiter Pedersen
b407c86d03 C++: Make Code Scanning happy. 2024-02-16 13:51:34 +01:00
Mathias Vorreiter Pedersen
57c1bf5835 C++: Add file-level QLDoc. 2024-02-16 13:47:02 +01:00
Mathias Vorreiter Pedersen
497592a4d4 C++: Add change note. 2024-02-16 13:36:25 +01:00
Tamas Vajk
ce0159c005 Add dotnet core dependencies to the integration test 2024-02-16 13:35:18 +01:00
Tamas Vajk
7e912f0de0 Rename integration test 2024-02-16 13:31:08 +01:00
Mathias Vorreiter Pedersen
9b2019db6b C++: Accept test changes. 2024-02-16 13:10:41 +01:00
Mathias Vorreiter Pedersen
499ab0892f C++: Currently, to catch flow in an example such as:
```cpp
char* source();
void sink(const char*);
int sprintf(char *, const char *, ...);

void call_sprintf(char* path, char* data) {
        sprintf(path, "%s", "abc"); // (1)
        sprintf(path, "%s", data); // (2)
}

void foo() {
        char path[10];
        call_sprintf(path, source()); // (3)
        sink(path);
}
```
we identify that the `*path [post update]` node at `// (2)` is a
`ReturnNodeExt` and since `*data` flows to that node flow will be carried
out to `*path [post update]` at // (3) and thus reach `sink(path)`.

The reason `*path [post update]` at `// 2` is recognized as a `ReturnNodeExt`
is because it satisfies the following condition (which is identified by the
shared dataflow library):
There is flow from the parameter node `*path` to the pre-update node of the
post-update node `*path [post update]` at `// (2)`.

However, when we start recognizing that the call to `sprintf(path, ...)` at
`// (1)` overrides the value of `*path` and no longer provide use-use flow out
of `*path` the `*path [post update]` node at `// (2)` is no longer recognized
as a `ReturnNodeExt` (because it doesn't satisfy the above criteria).

Thus, we need to identify the flow above without relying on the dataflow
library's summary mechanism. That is, instead of relying on the dataflow
library's mechanism to summarize the `*data -> *path` flow for `call_sprintf`
we need to:
- Ensure that the write to `*path` at `// (2)` is recognized as the "final"
write to the parameter, and
- Ensure that there's flow out of that parameter and back to
`*path [post update]` at `// (3)`.

Luckiky, we do all of this already to support flow out of writes to parameters
that don't have post-update nodes. For example, in something like:
```cpp
void set(int* x, int y) {
  *x = y;
}

void test() {
  int x;
  set(&x, source());
  sink(x);
}
```
So in order to make the original example work, all we need to do is to remove
the restrictions on this mechanism so that the same mechanism that makes the
above example work also makes the original example work!
2024-02-16 13:09:45 +01:00
Joe Farebrother
9ad05fe51c Address reveiws - Add BAD example to doc, add doc example to tests and fix typo. 2024-02-16 12:00:51 +00:00
Mathias Vorreiter Pedersen
7e9bf2a880 C++: Add a model for 'partial updating' and extend models appropriately. 2024-02-16 12:56:19 +01:00
Mathias Vorreiter Pedersen
24a63ae94d C++: Block flow by default. 2024-02-16 12:56:19 +01:00
Mathias Vorreiter Pedersen
625c47fa9c C++: Add a testcase. 2024-02-16 12:56:19 +01:00
Tamas Vajk
1e75c73825 Fix failing integration test 2024-02-16 12:50:13 +01:00
Tamas Vajk
f8b29ad70e Introduce environment variable to specify framework assembly locations 2024-02-16 11:54:19 +01:00