From 85f86399f417b0bf494a62bcbb90b91928a067e4 Mon Sep 17 00:00:00 2001 From: Akshat Kumar Date: Tue, 22 Jan 2013 14:03:30 -0500 Subject: [PATCH] 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 --- src/pkg/syscall/asm_plan9_amd64.s | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 -- 2.48.1