]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: correct netbsd/amd64 assembly for timespec handling
authorJoel Sing <joel@sing.id.au>
Thu, 16 May 2019 15:25:55 +0000 (01:25 +1000)
committerJoel Sing <joel@sing.id.au>
Fri, 17 May 2019 14:32:34 +0000 (14:32 +0000)
A timespec on netbsd/amd64 is int64/int64, not int64/int32.
This bug appears to have been introduced in 7777bac6e45.

Spotted by Cherry Zhang while reviewing https://go-review.googlesource.com/c/go/+/177120.

Change-Id: I163c55d926965defd981bdbfd2511de7d9d4c542
Reviewed-on: https://go-review.googlesource.com/c/go/+/177637
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Benny Siegert <bsiegert@gmail.com>

src/runtime/sys_netbsd_amd64.s

index 77dc00dc60c81ebe44ba1cbe7912a05dde857968..5fc47aefd3f8206cab6defe8e827dfd28c706158 100644 (file)
@@ -218,7 +218,7 @@ TEXT runtime·walltime(SB), NOSPLIT, $32
        MOVL    $SYS___clock_gettime50, AX
        SYSCALL
        MOVQ    8(SP), AX               // sec
-       MOVL    16(SP), DX              // nsec
+       MOVQ    16(SP), DX              // nsec
 
        // sec is in AX, nsec in DX
        MOVQ    AX, sec+0(FP)
@@ -231,7 +231,7 @@ TEXT runtime·nanotime(SB),NOSPLIT,$32
        MOVL    $SYS___clock_gettime50, AX
        SYSCALL
        MOVQ    8(SP), AX               // sec
-       MOVL    16(SP), DX              // nsec
+       MOVQ    16(SP), DX              // nsec
 
        // sec is in AX, nsec in DX
        // return nsec in AX