]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: enable #cgo noescape/nocallback
authordoujiang24 <doujiang24@gmail.com>
Fri, 16 Aug 2024 07:32:00 +0000 (07:32 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 16 Aug 2024 23:44:54 +0000 (23:44 +0000)
commitff271cd391bdb8963b5409c6f4cca40af8501b51
treeaf15c20d047786edb71e8bcdf94f5545055b81b1
parent96ef6abcca2f3ba43ae822d5a6e46fc02092e0a3
cmd/cgo: enable #cgo noescape/nocallback

In Go 1.22 we added code to the go/build package to ignore #cgo noescape
and nocallback directives. That permits us to enable these directives in Go 1.24.

Also, this fixed a Bug in CL 497837:
After retiring _Cgo_use for parameters, the compiler will treat the
parameters, start from the second, as non-alive. Then, they will be marked
as scalar in stackmap, which means the pointer won't be copied correctly
in copystack.

Fixes #56378.
Fixes #63739.

Change-Id: I46e773240f8a467c3c4ba201dc5b4ee473cf6e3e
GitHub-Last-Rev: 42fcc506d6a7681ef24ac36a5904b57bda4b15cd
GitHub-Pull-Request: golang/go#66879
Reviewed-on: https://go-review.googlesource.com/c/go/+/579955
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/cgo/doc.go
src/cmd/cgo/gcc.go
src/cmd/cgo/internal/test/test.go
src/cmd/cgo/internal/testerrors/testdata/notmatchedcfunction.go
src/cmd/cgo/out.go
src/runtime/cgo.go
src/runtime/crash_cgo_test.go
src/runtime/linkname.go
src/runtime/testdata/testprogcgo/cgonocallback.go
src/runtime/testdata/testprogcgo/cgonoescape.go
src/runtime/testdata/testprogcgo/issue63739.go [new file with mode: 0644]