aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_arm64.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/sys_linux_arm64.s')
-rw-r--r--src/runtime/sys_linux_arm64.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/sys_linux_arm64.s b/src/runtime/sys_linux_arm64.s
index ddfb13d7a1..8a0f06f206 100644
--- a/src/runtime/sys_linux_arm64.s
+++ b/src/runtime/sys_linux_arm64.s
@@ -239,10 +239,14 @@ noswitch:
// so don't bother saving g.
// When using cgo, we already saved g on TLS, also don't save
// g here.
+ // Also don't save g if we are already on the signal stack.
+ // We won't get a nested signal.
MOVBU runtime·iscgo(SB), R22
CBNZ R22, nosaveg
MOVD m_gsignal(R21), R22 // g.m.gsignal
CBZ R22, nosaveg
+ CMP g, R22
+ BEQ nosaveg
MOVD (g_stack+stack_lo)(R22), R22 // g.m.gsignal.stack.lo
MOVD g, (R22)
@@ -303,10 +307,14 @@ noswitch:
// so don't bother saving g.
// When using cgo, we already saved g on TLS, also don't save
// g here.
+ // Also don't save g if we are already on the signal stack.
+ // We won't get a nested signal.
MOVBU runtime·iscgo(SB), R22
CBNZ R22, nosaveg
MOVD m_gsignal(R21), R22 // g.m.gsignal
CBZ R22, nosaveg
+ CMP g, R22
+ BEQ nosaveg
MOVD (g_stack+stack_lo)(R22), R22 // g.m.gsignal.stack.lo
MOVD g, (R22)