]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: tricky replacements of _g_ in os3_plan9.go
authorMichael Pratt <mpratt@google.com>
Wed, 20 Jul 2022 15:45:26 +0000 (11:45 -0400)
committerMichael Pratt <mpratt@google.com>
Tue, 2 Aug 2022 18:51:38 +0000 (18:51 +0000)
Change-Id: I2a3ec71a33380b1215b9ab1ceb0a9b0e2bf7835b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418582
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/os3_plan9.go

index e901b3e9ddfd1b9c2593acd61146c626ceea7156..8c9cbe28ec2fb75196471bc6eb842768f2b836ed 100644 (file)
@@ -14,7 +14,9 @@ import (
 //
 //go:nowritebarrierrec
 func sighandler(_ureg *ureg, note *byte, gp *g) int {
-       _g_ := getg()
+       gsignal := getg()
+       mp := gsignal.m
+
        var t sigTabT
        var docrash bool
        var sig int
@@ -61,7 +63,7 @@ func sighandler(_ureg *ureg, note *byte, gp *g) int {
        if flags&_SigPanic != 0 {
                // Copy the error string from sigtramp's stack into m->notesig so
                // we can reliably access it from the panic routines.
-               memmove(unsafe.Pointer(_g_.m.notesig), unsafe.Pointer(note), uintptr(len(notestr)+1))
+               memmove(unsafe.Pointer(mp.notesig), unsafe.Pointer(note), uintptr(len(notestr)+1))
                gp.sig = uint32(sig)
                gp.sigpc = c.pc()
 
@@ -120,8 +122,8 @@ func sighandler(_ureg *ureg, note *byte, gp *g) int {
                return _NCONT
        }
 Throw:
-       _g_.m.throwing = throwTypeRuntime
-       _g_.m.caughtsig.set(gp)
+       mp.throwing = throwTypeRuntime
+       mp.caughtsig.set(gp)
        startpanic_m()
        print(notestr, "\n")
        print("PC=", hex(c.pc()), "\n")