From 54a0ab3f7b240dcd6829d636cff3a40d19d5b266 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 20 Jul 2022 11:45:26 -0400 Subject: runtime: tricky replacements of _g_ in os3_plan9.go Change-Id: I2a3ec71a33380b1215b9ab1ceb0a9b0e2bf7835b Reviewed-on: https://go-review.googlesource.com/c/go/+/418582 TryBot-Result: Gopher Robot Run-TryBot: Michael Pratt Reviewed-by: Austin Clements --- src/runtime/os3_plan9.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/runtime/os3_plan9.go b/src/runtime/os3_plan9.go index e901b3e9dd..8c9cbe28ec 100644 --- a/src/runtime/os3_plan9.go +++ b/src/runtime/os3_plan9.go @@ -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") -- cgit v1.2.3-54-g00ecf