]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: restore the g pointer correctly in crosscall_s390x
authorMichael Munday <munday@ca.ibm.com>
Wed, 8 Jun 2016 16:11:44 +0000 (16:11 +0000)
committerMichael Munday <munday@ca.ibm.com>
Wed, 8 Jun 2016 18:09:47 +0000 (18:09 +0000)
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>

src/runtime/cgo/gcc_s390x.S

index 6b163d0d21c325ccc8547939261939ef10dc45db..022f82d93e170a8250c49b387ed4caa66be693aa 100644 (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