]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: use sigpanic0 on all OSes
authorAustin Clements <austin@google.com>
Thu, 8 Apr 2021 21:41:24 +0000 (17:41 -0400)
committerAustin Clements <austin@google.com>
Fri, 9 Apr 2021 17:49:01 +0000 (17:49 +0000)
With the register ABI, it's important to inject sigpanic0 instead of
sigpanic so we can set up function entry registers. This was already
happening on most OSes. This CL gets the remaining ones.

Change-Id: I6bc4d912b6497e03ed54d0a9c1eae8fd099d2cea
Reviewed-on: https://go-review.googlesource.com/c/go/+/308930
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/runtime/os3_plan9.go
src/runtime/signal_windows.go
src/runtime/stubs.go

index b6ee98cab6e79bc31d051f7d104a4a46c7d9e97b..c5dc23de8b60898ee02c8c796c7517222648a635 100644 (file)
@@ -100,7 +100,7 @@ func sighandler(_ureg *ureg, note *byte, gp *g) int {
                if usesLR {
                        c.setpc(funcPC(sigpanictramp))
                } else {
-                       c.setpc(funcPC(sigpanic))
+                       c.setpc(funcPC(sigpanic0))
                }
                return _NCONT
        }
index 63158f0bc4c9dcc7ecc4d11f72290325733d7e3d..f2ce24d735cf1c20ebc29ff797edeca05d866ca0 100644 (file)
@@ -145,7 +145,7 @@ func exceptionhandler(info *exceptionrecord, r *context, gp *g) int32 {
                        *((*uintptr)(sp)) = r.ip()
                }
        }
-       r.set_ip(funcPC(sigpanic))
+       r.set_ip(funcPC(sigpanic0))
        return _EXCEPTION_CONTINUE_EXECUTION
 }
 
index f11ec539df0bf0f1a4e66d456070e3b7c3ba5c5e..f635d942e471584a5111bb274100f71be5c7d257 100644 (file)
@@ -394,8 +394,10 @@ func duffcopy()
 // Called from linker-generated .initarray; declared for go vet; do NOT call from Go.
 func addmoduledata()
 
-// Injected by the signal handler for panicking signals. On many platforms it just
-// jumps to sigpanic.
+// Injected by the signal handler for panicking signals.
+// Initializes any registers that have fixed meaning at calls but
+// are scratch in bodies and calls sigpanic.
+// On many platforms it just jumps to sigpanic.
 func sigpanic0()
 
 // intArgRegs is used by the various register assignment