Skip to content

Commit d0e0a7b

Browse files
committed
Merge branch 'main' into http
2 parents 333b183 + 9054f16 commit d0e0a7b

36 files changed

+700
-523
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ use_repo(
243243
)
244244

245245
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
246-
go_sdk.download(version = "1.23.1")
246+
go_sdk.download(version = "1.24.0")
247247

248248
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
249249
go_deps.from_file(go_mod = "//go/extractor:go.mod")

go/actions/test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
go-test-version:
55
description: Which Go version to use for running the tests
66
required: false
7-
default: "~1.23.1"
7+
default: "~1.24.0"
88
run-code-checks:
99
description: Whether to run formatting, code and qhelp generation checks
1010
required: false

go/extractor/autobuilder/build-environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
var minGoVersion = util.NewSemVer("1.11")
15-
var maxGoVersion = util.NewSemVer("1.23")
15+
var maxGoVersion = util.NewSemVer("1.24")
1616

1717
type versionInfo struct {
1818
goModVersion util.SemVer // The version of Go found in the go directive in the `go.mod` file.

go/extractor/extractor.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,12 @@ func extractObjects(tw *trap.Writer, scope *types.Scope, scopeLabel trap.Label)
477477
}
478478
// Populate type parameter parents for named types.
479479
if typeNameObj, ok := obj.(*types.TypeName); ok {
480+
// `types.TypeName` represents a type with a name: a defined
481+
// type, an alias type, a type parameter, or a predeclared
482+
// type such as `int` or `error`. We can distinguish these
483+
// using `typeNameObj.Type()`, except that we need to be
484+
// careful with alias types because before Go 1.24 they would
485+
// return the underlying type.
480486
if tp, ok := typeNameObj.Type().(*types.Named); ok && !typeNameObj.IsAlias() {
481487
populateTypeParamParents(tp.TypeParams(), obj)
482488
} else if tp, ok := typeNameObj.Type().(*types.Alias); ok {

go/extractor/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/github/codeql-go/extractor
22

3-
go 1.23
3+
go 1.24
44

5-
toolchain go1.23.1
5+
toolchain go1.24.0
66

77
// when updating this, run
88
// bazel run @rules_go//go -- mod tidy

go/extractor/project/project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func findGoModFiles(root string) []string {
193193
}
194194

195195
// A regular expression for the Go toolchain version syntax.
196-
var toolchainVersionRe *regexp.Regexp = regexp.MustCompile(`(?m)^([0-9]+\.[0-9]+\.[0-9]+)$`)
196+
var toolchainVersionRe *regexp.Regexp = regexp.MustCompile(`(?m)^([0-9]+\.[0-9]+(\.[0-9]+|rc[0-9]+))$`)
197197

198198
// Returns true if the `go.mod` file specifies a Go language version, that version is `1.21` or greater, and
199199
// there is no `toolchain` directive, and the Go language version is not a valid toolchain version.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Taint models have been added for the `weak` package, which was added in Go 1.24.
5+
* Taint models have been added for the interfaces `TextAppender` and `BinaryAppender` in the `encoding` package, which were added in Go 1.24.

go/ql/lib/ext/encoding.model.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ extensions:
33
pack: codeql/go-all
44
extensible: summaryModel
55
data:
6+
- ["encoding", "BinaryAppender", True, "AppendBinary", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
7+
- ["encoding", "BinaryAppender", True, "AppendBinary", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
68
- ["encoding", "BinaryMarshaler", True, "MarshalBinary", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
79
- ["encoding", "BinaryUnmarshaler", True, "UnmarshalBinary", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
10+
- ["encoding", "TextAppender", True, "AppendText", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
11+
- ["encoding", "TextAppender", True, "AppendText", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
812
- ["encoding", "TextMarshaler", True, "MarshalText", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
913
- ["encoding", "TextUnmarshaler", True, "UnmarshalText", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]

go/ql/lib/ext/weak.model.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: summaryModel
5+
data:
6+
- ["weak", "", False, "Make", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
7+
- ["weak", "Pointer", False, "Value", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]

go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,62 @@ numberOfTypeParameters
6363
| internal/bytealg.HashStrRev | 0 | T | interface { string \| []uint8 } |
6464
| internal/bytealg.IndexRabinKarp | 0 | T | interface { string \| []uint8 } |
6565
| internal/bytealg.LastIndexRabinKarp | 0 | T | interface { string \| []uint8 } |
66+
| internal/poll.ignoringEINTR2 | 0 | T | interface { } |
6667
| internal/runtime/atomic.Pointer.CompareAndSwap | 0 | T | interface { } |
6768
| internal/runtime/atomic.Pointer.CompareAndSwapNoWB | 0 | T | interface { } |
6869
| internal/runtime/atomic.Pointer.Load | 0 | T | interface { } |
6970
| internal/runtime/atomic.Pointer.Store | 0 | T | interface { } |
7071
| internal/runtime/atomic.Pointer.StoreNoWB | 0 | T | interface { } |
72+
| internal/sync.HashTrieMap.All | 0 | K | comparable |
73+
| internal/sync.HashTrieMap.All | 1 | V | interface { } |
74+
| internal/sync.HashTrieMap.CompareAndDelete | 0 | K | comparable |
75+
| internal/sync.HashTrieMap.CompareAndDelete | 1 | V | interface { } |
76+
| internal/sync.HashTrieMap.CompareAndSwap | 0 | K | comparable |
77+
| internal/sync.HashTrieMap.CompareAndSwap | 1 | V | interface { } |
78+
| internal/sync.HashTrieMap.Delete | 0 | K | comparable |
79+
| internal/sync.HashTrieMap.Load | 0 | K | comparable |
80+
| internal/sync.HashTrieMap.Load | 1 | V | interface { } |
81+
| internal/sync.HashTrieMap.LoadAndDelete | 0 | K | comparable |
82+
| internal/sync.HashTrieMap.LoadAndDelete | 1 | V | interface { } |
83+
| internal/sync.HashTrieMap.LoadOrStore | 0 | K | comparable |
84+
| internal/sync.HashTrieMap.LoadOrStore | 1 | V | interface { } |
85+
| internal/sync.HashTrieMap.Range | 0 | K | comparable |
86+
| internal/sync.HashTrieMap.Range | 1 | V | interface { } |
87+
| internal/sync.HashTrieMap.Store | 0 | K | comparable |
88+
| internal/sync.HashTrieMap.Store | 1 | V | interface { } |
89+
| internal/sync.HashTrieMap.Swap | 0 | K | comparable |
90+
| internal/sync.HashTrieMap.Swap | 1 | V | interface { } |
91+
| internal/sync.HashTrieMap.find | 0 | K | comparable |
92+
| internal/sync.HashTrieMap.find | 1 | V | interface { } |
93+
| internal/sync.HashTrieMap.iter | 0 | K | comparable |
94+
| internal/sync.HashTrieMap.iter | 1 | V | interface { } |
95+
| internal/sync.entry | 0 | K | comparable |
96+
| internal/sync.entry | 1 | V | interface { } |
97+
| internal/sync.entry.compareAndDelete | 0 | K | comparable |
98+
| internal/sync.entry.compareAndDelete | 1 | V | interface { } |
99+
| internal/sync.entry.compareAndSwap | 0 | K | comparable |
100+
| internal/sync.entry.compareAndSwap | 1 | V | interface { } |
101+
| internal/sync.entry.loadAndDelete | 0 | K | comparable |
102+
| internal/sync.entry.loadAndDelete | 1 | V | interface { } |
103+
| internal/sync.entry.lookup | 0 | K | comparable |
104+
| internal/sync.entry.lookup | 1 | V | interface { } |
105+
| internal/sync.entry.lookupWithValue | 0 | K | comparable |
106+
| internal/sync.entry.lookupWithValue | 1 | V | interface { } |
107+
| internal/sync.entry.swap | 0 | K | comparable |
108+
| internal/sync.entry.swap | 1 | V | interface { } |
109+
| internal/sync.newEntryNode | 0 | K | comparable |
110+
| internal/sync.newEntryNode | 1 | V | interface { } |
71111
| iter.Pull | 0 | V | interface { } |
72112
| iter.Pull2 | 0 | K | interface { } |
73113
| iter.Pull2 | 1 | V | interface { } |
74114
| iter.Seq | 0 | V | interface { } |
75115
| iter.Seq2 | 0 | K | interface { } |
76116
| iter.Seq2 | 1 | V | interface { } |
117+
| os.doInRoot | 0 | T | interface { } |
118+
| os.ignoringEINTR2 | 0 | T | interface { } |
77119
| reflect.rangeNum | 1 | N | interface { int64 \| uint64 } |
120+
| runtime.AddCleanup | 0 | T | interface { } |
121+
| runtime.AddCleanup | 1 | S | interface { } |
78122
| runtime.fandbits | 0 | F | floaty |
79123
| runtime.fmax | 0 | F | floaty |
80124
| runtime.fmin | 0 | F | floaty |

0 commit comments

Comments
 (0)