runtime: fix context clobbering on AIX

On AIX 64-bits, r13 is a pointer to thread data.
setcontext() overwrites r13 with the value saved by getcontext().
So, when a goroutine is scheduled on a new thread, r13 will point
to the old thread data after calling setcontext().

Code courtesy of Damien Bergamini.

Issue golang/go#19200

Change-Id: I579f002834b467cfbac888feea4951452881fb08
Reviewed-on: https://go-review.googlesource.com/41854
Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 file changed