Skip to content

Commit c5284eb

Browse files
committed
Merge branch 'main' into okerr
2 parents 0ef4c6f + 23fb139 commit c5284eb

File tree

17 files changed

+441
-452
lines changed

17 files changed

+441
-452
lines changed

docs/codeql/reusables/supported-versions-compilers.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
.NET Core up to 3.1
1717

1818
.NET 5, .NET 6, .NET 7, .NET 8, .NET 9","``.sln``, ``.csproj``, ``.cs``, ``.cshtml``, ``.xaml``"
19-
Go (aka Golang), "Go up to 1.23", "Go 1.11 or more recent", ``.go``
19+
Go (aka Golang), "Go up to 1.24", "Go 1.11 or more recent", ``.go``
2020
Java,"Java 7 to 22 [5]_","javac (OpenJDK and Oracle JDK),
2121

2222
Eclipse compiler for Java (ECJ) [6]_",``.java``

go/documentation/library-coverage/coverage.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ github.com/spf13/afero,34,,,,,,,,34,,,,,,,,,,,,,,,,,,
9595
github.com/square/go-jose,3,,4,,2,1,,,,,,,,,,,,,,,,,,,,4,
9696
github.com/uptrace/bun,63,,,,,,,,,,,,,,63,,,,,,,,,,,,
9797
github.com/valyala/fasthttp,35,50,5,,,,,,8,,,,17,8,,2,,,,,,,,50,,5,
98-
go.mongodb.org/mongo-driver/mongo,14,,,,,,,14,,,,,,,,,,,,,,,,,,,
98+
go.mongodb.org/mongo-driver/mongo,14,11,5,,,,,14,,,,,,,,,,,,,11,,,,,5,
9999
go.uber.org/zap,33,,11,,,,33,,,,,,,,,,,,,,,,,,,11,
100100
golang.org/x/crypto/ssh,4,,,4,,,,,,,,,,,,,,,,,,,,,,,
101101
golang.org/x/net/context,,,5,,,,,,,,,,,,,,,,,,,,,,,5,

go/documentation/library-coverage/coverage.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Go framework & library support
2828
`Kubernetes <https://kubernetes.io/>`_,"``k8s.io/api*``, ``k8s.io/apimachinery*``",,57,
2929
`Logrus <https://github.com/sirupsen/logrus>`_,"``github.com/Sirupsen/logrus*``, ``github.com/sirupsen/logrus*``",,,290
3030
`Macaron <https://gopkg.in/macaron.v1>`_,``gopkg.in/macaron*``,12,1,1
31-
`MongoDB Go Driver <https://www.mongodb.com/docs/drivers/go/current/>`_,``go.mongodb.org/mongo-driver*``,,,14
31+
`MongoDB Go Driver <https://www.mongodb.com/docs/drivers/go/current/>`_,``go.mongodb.org/mongo-driver*``,11,5,14
3232
`Revel <http://revel.github.io/>`_,"``github.com/revel/revel*``, ``github.com/robfig/revel*``",46,20,4
3333
`SendGrid <https://github.com/sendgrid/sendgrid-go>`_,``github.com/sendgrid/sendgrid-go*``,,1,
3434
`Squirrel <https://github.com/Masterminds/squirrel>`_,"``github.com/Masterminds/squirrel*``, ``github.com/lann/squirrel*``, ``gopkg.in/Masterminds/squirrel``",,,96
@@ -73,5 +73,5 @@ Go framework & library support
7373
`xpathparser <https://github.com/santhosh-tekuri/xpathparser>`_,``github.com/santhosh-tekuri/xpathparser*``,,,2
7474
`yaml <https://gopkg.in/yaml.v3>`_,``gopkg.in/yaml*``,,9,
7575
`zap <https://go.uber.org/zap>`_,``go.uber.org/zap*``,,11,33
76-
Totals,,459,947,1532
76+
Totals,,470,952,1532
7777

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The location info for the following classes has been changed slightly to match a location that is in the database: `BasicBlock`, `ControlFlow::EntryNode`, `ControlFlow::ExitNode`, `ControlFlow::ConditionGuardNode`, `IR::ImplicitLiteralElementIndexInstruction`, `IR::EvalImplicitTrueInstruction`, `SsaImplicitDefinition`, `SsaPhiNode`.

go/ql/lib/semmle/go/controlflow/BasicBlocks.qll

+1-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ class BasicBlock extends TControlFlowNode {
124124
predicate hasLocationInfo(
125125
string filepath, int startline, int startcolumn, int endline, int endcolumn
126126
) {
127-
this.getFirstNode().hasLocationInfo(filepath, startline, startcolumn, _, _) and
128-
this.getLastNode().hasLocationInfo(_, _, _, endline, endcolumn)
127+
this.getFirstNode().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
129128
}
130129
}
131130

go/ql/lib/semmle/go/controlflow/ControlFlowGraph.qll

+1-3
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,7 @@ module ControlFlow {
247247
override predicate hasLocationInfo(
248248
string filepath, int startline, int startcolumn, int endline, int endcolumn
249249
) {
250-
cond.hasLocationInfo(filepath, _, _, startline, startcolumn) and
251-
endline = startline and
252-
endcolumn = startcolumn
250+
cond.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
253251
}
254252
}
255253

go/ql/lib/semmle/go/controlflow/ControlFlowGraphImpl.qll

+2-6
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,7 @@ class EntryNode extends ControlFlow::Node, MkEntryNode {
440440
override predicate hasLocationInfo(
441441
string filepath, int startline, int startcolumn, int endline, int endcolumn
442442
) {
443-
root.hasLocationInfo(filepath, startline, startcolumn, _, _) and
444-
endline = startline and
445-
endcolumn = startcolumn
443+
root.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
446444
}
447445
}
448446

@@ -461,9 +459,7 @@ class ExitNode extends ControlFlow::Node, MkExitNode {
461459
override predicate hasLocationInfo(
462460
string filepath, int startline, int startcolumn, int endline, int endcolumn
463461
) {
464-
root.hasLocationInfo(filepath, _, _, endline, endcolumn) and
465-
endline = startline and
466-
endcolumn = startcolumn
462+
root.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
467463
}
468464
}
469465

go/ql/lib/semmle/go/controlflow/IR.qll

+2-6
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,7 @@ module IR {
647647
override predicate hasLocationInfo(
648648
string filepath, int startline, int startcolumn, int endline, int endcolumn
649649
) {
650-
elt.hasLocationInfo(filepath, startline, startcolumn, _, _) and
651-
endline = startline and
652-
endcolumn = startcolumn
650+
elt.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
653651
}
654652
}
655653

@@ -1231,9 +1229,7 @@ module IR {
12311229
override predicate hasLocationInfo(
12321230
string filepath, int startline, int startcolumn, int endline, int endcolumn
12331231
) {
1234-
stmt.hasLocationInfo(filepath, startline, startcolumn, _, _) and
1235-
endline = startline and
1236-
endcolumn = startcolumn
1232+
stmt.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
12371233
}
12381234
}
12391235

go/ql/lib/semmle/go/dataflow/SSA.qll

+2-6
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ abstract class SsaImplicitDefinition extends SsaDefinition {
217217
override predicate hasLocationInfo(
218218
string filepath, int startline, int startcolumn, int endline, int endcolumn
219219
) {
220-
endline = startline and
221-
endcolumn = startcolumn and
222-
this.getBasicBlock().hasLocationInfo(filepath, startline, startcolumn, _, _)
220+
this.getBasicBlock().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
223221
}
224222
}
225223

@@ -296,9 +294,7 @@ class SsaPhiNode extends SsaPseudoDefinition, TPhi {
296294
override predicate hasLocationInfo(
297295
string filepath, int startline, int startcolumn, int endline, int endcolumn
298296
) {
299-
endline = startline and
300-
endcolumn = startcolumn and
301-
this.getBasicBlock().hasLocationInfo(filepath, startline, startcolumn, _, _)
297+
this.getBasicBlock().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
302298
}
303299
}
304300

go/ql/test/extractor-tests/go1.17/CFG.expected

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ nodes
22
edges
33
| conversions.go:0:0:0:0 | entry | conversions.go:3:1:3:15 | skip |
44
| conversions.go:3:1:3:15 | skip | conversions.go:5:6:5:8 | skip |
5-
| conversions.go:5:1:5:1 | entry | conversions.go:5:10:5:10 | argument corresponding to _ |
5+
| conversions.go:5:1:5:29 | entry | conversions.go:5:10:5:10 | argument corresponding to _ |
66
| conversions.go:5:1:5:29 | function declaration | conversions.go:7:6:7:9 | skip |
77
| conversions.go:5:6:5:8 | skip | conversions.go:5:1:5:29 | function declaration |
88
| conversions.go:5:10:5:10 | argument corresponding to _ | conversions.go:5:10:5:10 | initialization of _ |
99
| conversions.go:5:10:5:10 | initialization of _ | conversions.go:5:28:5:29 | skip |
10-
| conversions.go:5:28:5:29 | skip | conversions.go:5:29:5:29 | exit |
11-
| conversions.go:7:1:7:1 | entry | conversions.go:8:6:8:6 | skip |
10+
| conversions.go:5:28:5:29 | skip | conversions.go:5:1:5:29 | exit |
11+
| conversions.go:7:1:26:1 | entry | conversions.go:8:6:8:6 | skip |
1212
| conversions.go:7:1:26:1 | function declaration | conversions.go:0:0:0:0 | exit |
1313
| conversions.go:7:6:7:9 | skip | conversions.go:7:1:26:1 | function declaration |
1414
| conversions.go:8:6:8:6 | assignment to a | conversions.go:10:2:10:2 | skip |
@@ -21,8 +21,8 @@ edges
2121
| conversions.go:10:18:10:18 | a | conversions.go:10:21:10:22 | 10 |
2222
| conversions.go:10:21:10:22 | 10 | conversions.go:10:7:10:23 | call to Add |
2323
| conversions.go:11:2:11:4 | use | conversions.go:11:6:11:6 | b |
24+
| conversions.go:11:2:11:7 | call to use | conversions.go:7:1:26:1 | exit |
2425
| conversions.go:11:2:11:7 | call to use | conversions.go:13:6:13:8 | skip |
25-
| conversions.go:11:2:11:7 | call to use | conversions.go:26:1:26:1 | exit |
2626
| conversions.go:11:6:11:6 | b | conversions.go:11:2:11:7 | call to use |
2727
| conversions.go:13:6:13:8 | assignment to arr | conversions.go:14:2:14:6 | skip |
2828
| conversions.go:13:6:13:8 | skip | conversions.go:13:6:13:8 | zero value for arr |
@@ -35,12 +35,12 @@ edges
3535
| conversions.go:14:29:14:30 | 20 | conversions.go:14:11:14:31 | call to Slice |
3636
| conversions.go:17:2:17:4 | assignment to ptr | conversions.go:18:2:18:4 | use |
3737
| conversions.go:17:2:17:4 | skip | conversions.go:17:20:17:24 | slice |
38+
| conversions.go:17:9:17:25 | type conversion | conversions.go:7:1:26:1 | exit |
3839
| conversions.go:17:9:17:25 | type conversion | conversions.go:17:2:17:4 | assignment to ptr |
39-
| conversions.go:17:9:17:25 | type conversion | conversions.go:26:1:26:1 | exit |
4040
| conversions.go:17:20:17:24 | slice | conversions.go:17:9:17:25 | type conversion |
4141
| conversions.go:18:2:18:4 | use | conversions.go:18:6:18:8 | ptr |
42+
| conversions.go:18:2:18:9 | call to use | conversions.go:7:1:26:1 | exit |
4243
| conversions.go:18:2:18:9 | call to use | conversions.go:21:2:21:4 | skip |
43-
| conversions.go:18:2:18:9 | call to use | conversions.go:26:1:26:1 | exit |
4444
| conversions.go:18:6:18:8 | ptr | conversions.go:18:2:18:9 | call to use |
4545
| conversions.go:21:2:21:4 | assignment to str | conversions.go:22:2:22:6 | skip |
4646
| conversions.go:21:2:21:4 | skip | conversions.go:21:9:21:18 | "a string" |
@@ -50,15 +50,15 @@ edges
5050
| conversions.go:22:11:22:21 | type conversion | conversions.go:22:2:22:6 | assignment to bytes |
5151
| conversions.go:22:18:22:20 | str | conversions.go:22:11:22:21 | type conversion |
5252
| conversions.go:23:2:23:4 | use | conversions.go:23:6:23:10 | bytes |
53+
| conversions.go:23:2:23:11 | call to use | conversions.go:7:1:26:1 | exit |
5354
| conversions.go:23:2:23:11 | call to use | conversions.go:24:2:24:6 | skip |
54-
| conversions.go:23:2:23:11 | call to use | conversions.go:26:1:26:1 | exit |
5555
| conversions.go:23:6:23:10 | bytes | conversions.go:23:2:23:11 | call to use |
5656
| conversions.go:24:2:24:6 | assignment to runes | conversions.go:25:2:25:4 | use |
5757
| conversions.go:24:2:24:6 | skip | conversions.go:24:18:24:20 | str |
5858
| conversions.go:24:11:24:21 | type conversion | conversions.go:24:2:24:6 | assignment to runes |
5959
| conversions.go:24:18:24:20 | str | conversions.go:24:11:24:21 | type conversion |
6060
| conversions.go:25:2:25:4 | use | conversions.go:25:6:25:10 | runes |
61-
| conversions.go:25:2:25:11 | call to use | conversions.go:26:1:26:1 | exit |
61+
| conversions.go:25:2:25:11 | call to use | conversions.go:7:1:26:1 | exit |
6262
| conversions.go:25:6:25:10 | runes | conversions.go:25:2:25:11 | call to use |
6363
#select
6464
| |

0 commit comments

Comments
 (0)