]> Cypherpunks repositories - gostls13.git/commit
cmd/compile,go/types: restrict use of unsafe.{Add,Slice} to go1.17 or newer
authorMatthew Dempsky <mdempsky@google.com>
Wed, 2 Jun 2021 19:22:50 +0000 (12:22 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 4 Jun 2021 01:31:23 +0000 (01:31 +0000)
commit962d5c997af450af1de9a38eb6510cdfc86ea689
tree9b9649ecc72d5a145a06916ed84d343a6f1820c3
parentb29b123e079183a05abc1066007a51d4f565cd88
cmd/compile,go/types: restrict use of unsafe.{Add,Slice} to go1.17 or newer

This CL updates cmd/compile (including types2) and go/types to report
errors about using unsafe.Add and unsafe.Slice when language
compatibility is set to Go 1.16 or older.

Fixes #46525.

Change-Id: I1bfe025a672d9f4b929f443064ad1effd38d0363
Reviewed-on: https://go-review.googlesource.com/c/go/+/324369
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/typecheck/func.go
src/cmd/compile/internal/types2/builtins.go
src/go/types/builtins.go
test/fixedbugs/issue46525.go [new file with mode: 0644]