From: Akshat Kumar Date: Tue, 22 Jan 2013 19:03:30 +0000 (-0500) Subject: syscall: fix arithmetic errors in assembly for seek function for 64-bit Plan 9 X-Git-Tag: go1.1rc2~1326 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=85f86399f417b0bf494a62bcbb90b91928a067e4;p=gostls13.git syscall: fix arithmetic errors in assembly for seek function for 64-bit Plan 9 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 --- diff --git a/src/pkg/syscall/asm_plan9_amd64.s b/src/pkg/syscall/asm_plan9_amd64.s index c0469760d8..673d53f008 100644 --- a/src/pkg/syscall/asm_plan9_amd64.s +++ b/src/pkg/syscall/asm_plan9_amd64.s @@ -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