aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/panic.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2024-05-22 23:06:30 -0400
committerGopher Robot <gobot@golang.org>2024-05-29 17:58:53 +0000
commit2a7ca156b8189c68c0a29b4c66194a42c5ce3c9b (patch)
tree7ac6dc198ebad85420719774562d29b7b59c6684 /src/runtime/panic.go
parent5121b45d7426687076c20ae0f4fcae1238f3ed47 (diff)
downloadgo-2a7ca156b8189c68c0a29b4c66194a42c5ce3c9b.tar.xz
all: document legacy //go:linkname for final round of modules
Add linknames for most modules with ≥50 dependents. Add linknames for a few other modules that we know are important but are below 50. Remove linknames from badlinkname.go that do not merit inclusion (very small number of dependents). We can add them back later if the need arises. Fixes #67401. (For now.) Change-Id: I1e49fec0292265256044d64b1841d366c4106002 Reviewed-on: https://go-review.googlesource.com/c/go/+/587756 Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Bypass: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/panic.go')
-rw-r--r--src/runtime/panic.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go
index 6929862a7d..98e96b12bf 100644
--- a/src/runtime/panic.go
+++ b/src/runtime/panic.go
@@ -720,6 +720,18 @@ func (*PanicNilError) RuntimeError() {}
var panicnil = &godebugInc{name: "panicnil"}
// The implementation of the predeclared function panic.
+// The compiler emits calls to this function.
+//
+// gopanic should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - go.undefinedlabs.com/scopeagent
+// - github.com/goplus/igop
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname gopanic
func gopanic(e any) {
if e == nil {
if debug.panicnil.Load() != 1 {
@@ -1036,6 +1048,7 @@ func sync_fatal(s string) {
// - github.com/outcaste-io/ristretto
// - github.com/pingcap/br
// - gvisor.dev/gvisor
+// - github.com/sagernet/gvisor
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.