]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: update outdated comments for deferprocStack
authorYoulin Feng <fengyoulin@live.com>
Sat, 25 Oct 2025 03:49:30 +0000 (11:49 +0800)
committerGopher Robot <gobot@golang.org>
Mon, 3 Nov 2025 18:44:04 +0000 (10:44 -0800)
Change-Id: I0ea4d15da163cec6fe2a703376ce5a6032e15484
Reviewed-on: https://go-review.googlesource.com/c/go/+/714861
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>

src/runtime/panic.go

index aee1cd0eed4570a3d212b33e9f71f49c94838458..ded85feffa12cbe6f2b191bf0c957c38cc0aa82a 100644 (file)
@@ -545,15 +545,13 @@ func deferprocStack(d *_defer) {
        d.rangefunc = false
        d.sp = sys.GetCallerSP()
        // The lines below implement:
-       //   d.panic = nil
-       //   d.fd = nil
        //   d.link = gp._defer
        //   d.head = nil
        //   gp._defer = d
-       // But without write barriers. The first three are writes to
+       // But without write barriers. The first two are writes to
        // the stack so they don't need a write barrier, and furthermore
        // are to uninitialized memory, so they must not use a write barrier.
-       // The fourth write does not require a write barrier because we
+       // The third write does not require a write barrier because we
        // explicitly mark all the defer structures, so we don't need to
        // keep track of pointers to them with a write barrier.
        *(*uintptr)(unsafe.Pointer(&d.link)) = uintptr(unsafe.Pointer(gp._defer))