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 <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Michael Pratt 2022-07-20 11:45:26 -04:00
parent 4240ff764b
commit 54a0ab3f7b

View 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")