runtime/cgo: restore the g pointer correctly in crosscall_s390x

R13 needs to be set to g because C code may have clobbered R13.

Fixes #16006.

Change-Id: I66311fe28440e85e589a1695fa1c42416583b4c6
Reviewed-on: https://go-review.googlesource.com/23910
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Munday 2016-06-08 16:11:44 +00:00
parent 09eedc32e1
commit 0324a3f828
1 changed files with 4 additions and 1 deletions

View File

@ -21,9 +21,12 @@ crosscall_s390x:
stdy %f4, 144(%r15)
stdy %f6, 152(%r15)
/* assumes this call does not clobber r2 or r15 */
/* set r0 to 0 */
xgr %r0, %r0
/* restore g pointer */
lgr %r13, %r3
/* grow stack 8 bytes and call fn */
agfi %r15, -8
basr %r14, %r2