From 9745397e1d5e84258887995fc3af6d9d3a5b0409 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 6 Mar 2018 14:30:26 +0100 Subject: [PATCH] runtime: fix stack switch check in walltime/nanotime on linux/arm CL 98095 got the check wrong. We should be testing 'getg() == getg().m.curg', not 'getg().m == getg().m.curg'. Change-Id: I32f6238b00409b67afa8efe732513d542aec5bc7 Reviewed-on: https://go-review.googlesource.com/98855 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/sys_linux_arm.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/sys_linux_arm.s b/src/runtime/sys_linux_arm.s index 2af9f29344..31923d36a4 100644 --- a/src/runtime/sys_linux_arm.s +++ b/src/runtime/sys_linux_arm.s @@ -221,7 +221,7 @@ TEXT runtime·walltime(SB),NOSPLIT,$0-12 MOVW g_m(g), R1 MOVW m_curg(R1), R0 - CMP R1, R0 // Only switch if on curg. + CMP g, R0 // Only switch if on curg. B.NE noswitch MOVW m_g0(R1), R0 @@ -266,7 +266,7 @@ TEXT runtime·nanotime(SB),NOSPLIT,$0-8 MOVW g_m(g), R1 MOVW m_curg(R1), R0 - CMP R1, R0 // Only switch if on curg. + CMP g, R0 // Only switch if on curg. B.NE noswitch MOVW m_g0(R1), R0 -- 2.50.0