]> Cypherpunks repositories - gostls13.git/commit
runtime: make unsafe.Slice usable from nowritebarrierrec
authorAustin Clements <austin@google.com>
Mon, 13 Feb 2023 20:55:21 +0000 (15:55 -0500)
committerAustin Clements <austin@google.com>
Fri, 10 Mar 2023 17:59:31 +0000 (17:59 +0000)
commitda384766a053d851d912f04afaa1113b627a0822
tree1b3187e09a6f9d0340da5d5166e3817117b1ad6b
parentf758d648b0aea95b10713864f20c957412ff9193
runtime: make unsafe.Slice usable from nowritebarrierrec

Many compiler-generated panics are dynamically changed to a "throw"
when they happen in the runtime. One effect of this is that they are
allowed in nowritebarrierrec contexts. Currently, the unsafe.Slice
panics don't have this treatment.

We're about to expose more code that uses unsafe.Slice to the write
barrier checker (it's actually already there and it just can't see
through an indirect call), so give these panics the dynamic check.

Very indirectly updates #54466.

Change-Id: I65cb96fa17eb751041e4fa25a1c1bd03246c82ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/468296
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/unsafe.go