]> Cypherpunks repositories - gostls13.git/commit
runtime: setg after sigFetchG
authorCherry Zhang <cherryyz@google.com>
Thu, 31 Oct 2019 03:14:34 +0000 (23:14 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 5 Nov 2019 18:58:29 +0000 (18:58 +0000)
commitfb05264fe1626c9d0b6d00d51e6c4d8d213d6dc7
tree687730953e056a28a397b884d7b00b830cf4ea62
parentc3cef0bfe5f503ee016fc61e58f5ee1b78dbd962
runtime: setg after sigFetchG

In the normal case, sigFetchG just returns the G register. But in
the case that sigFetchG fetches the G from somewhere else, the G
register still holding an invalid value. Setg here to make sure
they match.

This is particularly useful because setGsignalStack, called by
adjustSignalStack from sigtrampgo before setg to gsignal,
accesses the G register.

Should fix #35249.

Change-Id: I64c85143cb05cdb2ecca7f9936dbd8bfec186c2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/204441
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/signal_unix.go