]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/cgo: allow cgo to pass strings or []bytes bigger than 1<<30
authorKeith Randall <khr@golang.org>
Wed, 20 Jul 2022 19:46:33 +0000 (12:46 -0700)
committerKeith Randall <khr@google.com>
Wed, 20 Jul 2022 23:32:27 +0000 (23:32 +0000)
commit244c8b050093ec546311707760afaafabcbf2fef
tree308076ac0d4fa7034bdbbd99b863b43622b3a595
parentdf38614bd7f233f36a3f5ac07f0ec9029043243f
cmd/cgo: allow cgo to pass strings or []bytes bigger than 1<<30

There's no real reason to limit to 1<<30 bytes. Maybe it would catch
some mistakes, but probably ones that would quickly manifest in other
ways.

We can't use the fancy new unsafe.Slice function because this code
may still be generated for people with 1.16 or earlier in their go.mod file.
Use unsafe shenanigans instead.

Fixes #53965
Fixes #53958

Change-Id: Ibfa095192f50276091d6c2532e8ccd7832b57ca8
Reviewed-on: https://go-review.googlesource.com/c/go/+/418557
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/cgo/out.go