]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: fix arithmetic errors in assembly for seek function for 64-bit Plan 9
authorAkshat Kumar <seed@mail.nanosouffle.net>
Tue, 22 Jan 2013 19:03:30 +0000 (14:03 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 22 Jan 2013 19:03:30 +0000 (14:03 -0500)
Offsets for return values from seek were miscalculated
and a translation from 32-bit code for error handling
was incorrect.

R=rsc, rminnich, npe
CC=golang-dev
https://golang.org/cl/7181045

src/pkg/syscall/asm_plan9_amd64.s

index c0469760d873b930b9efdef8d8e17e27dd0a54f8..673d53f008c4ff0b9eed04e1c62b4d6c0d22f3b8 100644 (file)
@@ -128,7 +128,7 @@ TEXT        ·RawSyscall6(SB),7,$0
 
 //func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
 TEXT ·seek(SB),7,$0
-       LEAQ    newoffset+48(SP), AX
+       LEAQ    newoffset+40(SP), AX
        MOVQ    AX, placeholder+8(SP)
        
        MOVQ    $0x8000, AX     // for NxM
@@ -137,8 +137,7 @@ TEXT ·seek(SB),7,$0
        
        CMPQ    AX, $-1
        JNE     ok6
-       MOVQ    AX, 48(SP)      // newoffset low
-       MOVQ    AX, 56(SP)      // newoffset high
+       MOVQ    AX, 40(SP)      // newoffset
        
        SUBQ    $16, SP
        CALL    syscall·errstr(SB)
@@ -150,7 +149,7 @@ ok6:
        LEAQ    runtime·emptystring(SB), SI
        
 copyresult6:
-       LEAQ    err+64(SP), DI
+       LEAQ    err+48(SP), DI
 
        CLD
        MOVSQ