Skip to content

Commit 01d24c4

Browse files
committed
Merge branch 'main' into sqlx
2 parents 67c170f + 492e27b commit 01d24c4

File tree

45 files changed

+4318
-3453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4318
-3453
lines changed

.github/copilot-instructions.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,3 @@ When reviewing code:
22
* do not review changes in files with `.expected` extension (they are automatically ensured to be correct).
33
* in `.ql` and `.qll` files, do not try to review the code itself as you don't understand the programming language
44
well enough to make comments in these languages. You can still check for typos or comment improvements.
5-
6-
When editing `.ql` and `.qll` files:
7-
* All edited `.ql` and `.qll` files should be autoformatted afterwards using the CodeQL CLI.
8-
* To install and use the CodeQL CLI autoformatter:
9-
1. Download and extract CodeQL CLI: `cd /tmp && curl -L -o codeql-linux64.zip https://github.com/github/codeql-cli-binaries/releases/latest/download/codeql-linux64.zip && unzip -q codeql-linux64.zip`
10-
2. Add to PATH: `export PATH="/tmp/codeql:$PATH"`
11-
3. Run autoformatter: `codeql query format [file] --in-place`

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ use_repo(
230230
"kotlin-compiler-2.1.0-Beta1",
231231
"kotlin-compiler-2.1.20-Beta1",
232232
"kotlin-compiler-2.2.0-Beta1",
233-
"kotlin-compiler-2.2.20-Beta1",
233+
"kotlin-compiler-2.2.20-Beta2",
234234
"kotlin-compiler-embeddable-1.6.0",
235235
"kotlin-compiler-embeddable-1.6.20",
236236
"kotlin-compiler-embeddable-1.7.0",
@@ -243,7 +243,7 @@ use_repo(
243243
"kotlin-compiler-embeddable-2.1.0-Beta1",
244244
"kotlin-compiler-embeddable-2.1.20-Beta1",
245245
"kotlin-compiler-embeddable-2.2.0-Beta1",
246-
"kotlin-compiler-embeddable-2.2.20-Beta1",
246+
"kotlin-compiler-embeddable-2.2.20-Beta2",
247247
"kotlin-stdlib-1.6.0",
248248
"kotlin-stdlib-1.6.20",
249249
"kotlin-stdlib-1.7.0",
@@ -256,7 +256,7 @@ use_repo(
256256
"kotlin-stdlib-2.1.0-Beta1",
257257
"kotlin-stdlib-2.1.20-Beta1",
258258
"kotlin-stdlib-2.2.0-Beta1",
259-
"kotlin-stdlib-2.2.20-Beta1",
259+
"kotlin-stdlib-2.2.20-Beta2",
260260
)
261261

262262
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,19 +1982,23 @@ module IteratorFlow {
19821982

19831983
predicate allowFlowIntoUncertainDef(IteratorSsa::UncertainWriteDefinition def) { any() }
19841984

1985+
class GuardValue = Void;
1986+
19851987
class Guard extends Void {
1986-
predicate hasBranchEdge(SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, boolean branch) {
1988+
predicate hasValueBranchEdge(
1989+
SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, GuardValue val
1990+
) {
19871991
none()
19881992
}
19891993

1990-
predicate controlsBranchEdge(
1991-
SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, boolean branch
1994+
predicate valueControlsBranchEdge(
1995+
SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, GuardValue val
19921996
) {
19931997
none()
19941998
}
19951999
}
19962000

1997-
predicate guardDirectlyControlsBlock(Guard guard, SsaInput::BasicBlock bb, boolean branch) {
2001+
predicate guardDirectlyControlsBlock(Guard guard, SsaInput::BasicBlock bb, GuardValue val) {
19982002
none()
19992003
}
20002004

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,8 @@ class GlobalDef extends Definition {
961961
private module SsaImpl = SsaImplCommon::Make<Location, SsaInput>;
962962

963963
private module DataFlowIntegrationInput implements SsaImpl::DataFlowIntegrationInputSig {
964+
private import codeql.util.Boolean
965+
964966
class Expr extends Instruction {
965967
Expr() {
966968
exists(IRBlock bb, int i |
@@ -992,23 +994,29 @@ private module DataFlowIntegrationInput implements SsaImpl::DataFlowIntegrationI
992994
result instanceof FalseEdge
993995
}
994996

997+
class GuardValue = Boolean;
998+
995999
class Guard instanceof IRGuards::IRGuardCondition {
9961000
string toString() { result = super.toString() }
9971001

998-
predicate hasBranchEdge(SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, boolean branch) {
1002+
predicate hasValueBranchEdge(
1003+
SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, GuardValue branch
1004+
) {
9991005
exists(EdgeKind kind |
10001006
super.getBlock() = bb1 and
10011007
kind = getConditionalEdge(branch) and
10021008
bb1.getSuccessor(kind) = bb2
10031009
)
10041010
}
10051011

1006-
predicate controlsBranchEdge(SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, boolean branch) {
1007-
this.hasBranchEdge(bb1, bb2, branch)
1012+
predicate valueControlsBranchEdge(
1013+
SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, GuardValue branch
1014+
) {
1015+
this.hasValueBranchEdge(bb1, bb2, branch)
10081016
}
10091017
}
10101018

1011-
predicate guardDirectlyControlsBlock(Guard guard, SsaInput::BasicBlock bb, boolean branch) {
1019+
predicate guardDirectlyControlsBlock(Guard guard, SsaInput::BasicBlock bb, GuardValue branch) {
10121020
guard.(IRGuards::IRGuardCondition).controls(bb, branch)
10131021
}
10141022

@@ -1037,7 +1045,8 @@ module BarrierGuardWithIntParam<guardChecksNodeSig/4 guardChecksNode> {
10371045
}
10381046

10391047
private predicate guardChecks(
1040-
DataFlowIntegrationInput::Guard g, SsaImpl::Definition def, boolean branch, int indirectionIndex
1048+
DataFlowIntegrationInput::Guard g, SsaImpl::Definition def,
1049+
DataFlowIntegrationInput::GuardValue branch, int indirectionIndex
10411050
) {
10421051
exists(UseImpl use |
10431052
guardChecksNode(g, use.getNode(), branch, indirectionIndex) and

csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImpl.qll

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,8 @@ private module Cached {
975975
cached // nothing is actually cached
976976
module BarrierGuard<guardChecksSig/3 guardChecks> {
977977
private predicate guardChecksAdjTypes(
978-
DataFlowIntegrationInput::Guard g, DataFlowIntegrationInput::Expr e, boolean branch
978+
DataFlowIntegrationInput::Guard g, DataFlowIntegrationInput::Expr e,
979+
DataFlowIntegrationInput::GuardValue branch
979980
) {
980981
exists(Guards::AbstractValues::BooleanValue v |
981982
guardChecks(g, e.getAstNode(), v) and
@@ -1016,6 +1017,7 @@ string getToStringPrefix(Definition def) {
10161017
private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInputSig {
10171018
private import csharp as Cs
10181019
private import semmle.code.csharp.controlflow.BasicBlocks
1020+
private import codeql.util.Boolean
10191021

10201022
class Expr extends ControlFlow::Node {
10211023
predicate hasCfgNode(ControlFlow::BasicBlock bb, int i) { this = bb.getNode(i) }
@@ -1042,12 +1044,14 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
10421044
)
10431045
}
10441046

1047+
class GuardValue = Boolean;
1048+
10451049
class Guard extends Guards::Guard {
10461050
/**
10471051
* Holds if the evaluation of this guard to `branch` corresponds to the edge
10481052
* from `bb1` to `bb2`.
10491053
*/
1050-
predicate hasBranchEdge(BasicBlock bb1, BasicBlock bb2, boolean branch) {
1054+
predicate hasValueBranchEdge(BasicBlock bb1, BasicBlock bb2, GuardValue branch) {
10511055
exists(ControlFlow::SuccessorTypes::ConditionalSuccessor s |
10521056
this.getAControlFlowNode() = bb1.getLastNode() and
10531057
bb2 = bb1.getASuccessorByType(s) and
@@ -1060,13 +1064,13 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
10601064
* branch edge from `bb1` to `bb2`. That is, following the edge from
10611065
* `bb1` to `bb2` implies that this guard evaluated to `branch`.
10621066
*/
1063-
predicate controlsBranchEdge(BasicBlock bb1, BasicBlock bb2, boolean branch) {
1064-
this.hasBranchEdge(bb1, bb2, branch)
1067+
predicate valueControlsBranchEdge(BasicBlock bb1, BasicBlock bb2, GuardValue branch) {
1068+
this.hasValueBranchEdge(bb1, bb2, branch)
10651069
}
10661070
}
10671071

10681072
/** Holds if the guard `guard` controls block `bb` upon evaluating to `branch`. */
1069-
predicate guardDirectlyControlsBlock(Guard guard, ControlFlow::BasicBlock bb, boolean branch) {
1073+
predicate guardDirectlyControlsBlock(Guard guard, ControlFlow::BasicBlock bb, GuardValue branch) {
10701074
exists(ConditionBlock conditionBlock, ControlFlow::SuccessorTypes::ConditionalSuccessor s |
10711075
guard.getAControlFlowNode() = conditionBlock.getLastNode() and
10721076
s.getValue() = branch and

java/kotlin-extractor/deps/kotlin-compiler-2.2.20-Beta1.jar

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:c7f4befaac8055b86f648e82c13b86e2775d7ace4eb896e2d7a5b8669a0f29a7
3+
size 58317000

java/kotlin-extractor/deps/kotlin-compiler-embeddable-2.2.20-Beta1.jar

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:6017df3eca219e1c970468631f81333bfd8739482a5de4d33688949b5a1af376
3+
size 56885422

java/kotlin-extractor/deps/kotlin-stdlib-2.2.20-Beta1.jar

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)