]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: fix windows/arm externalthreadhandler
authorRuss Cox <rsc@golang.org>
Wed, 27 Jan 2021 16:27:25 +0000 (11:27 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 19 Feb 2021 00:04:07 +0000 (00:04 +0000)
commit5421c37a1db5098659f86b21d011fc263d93524e
treefc27b4aabac7a4b2e66d91f4dc35aee185476ec1
parent91cc484ea914fc75e7321d23017d59c9751f5066
runtime: fix windows/arm externalthreadhandler

Externalthreadhandler was not handling its own stack correctly.
It incorrectly referred to the saved LR slot (uninitialized, it turned out)
as holding the return value from the called function.

Externalthreadhandler is used to call two different functions:
profileloop1 and ctrlhandler1.
Profileloop1 does not return, so no harm done.
Ctrlhandler1 returns a boolean indicating whether the handler
took care of the control event (if true, no other handlers run).

It's hard to say exactly what uninitialized values are likely to
have been returned instead of ctrlhandler1's result, but it
probably wasn't helping matters.

Change-Id: Ia02f1c033df618cb82c2193b3a8241ed048a8b18
Reviewed-on: https://go-review.googlesource.com/c/go/+/288812
Trust: Russ Cox <rsc@golang.org>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/runtime/sys_windows_arm.s