Commit 9745397e authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

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 <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 85dcc709
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment