Skip to content

Commit 1ea7644

Browse files
committed
runtime: fix vet complaints for linux/arm
Working toward making the tree vet-safe instead of having so many exceptions in cmd/vet/all/whitelist. This CL makes "GOOS=linux GOARCH=arm go vet -unsafeptr=false runtime" happy, while keeping "GO_BUILDER_NAME=misc-vetall go tool dist test" happy too. For #31916. Change-Id: Ifae75b832320b5356ac8773cf85055bfb2bd7214 Reviewed-on: https://go-review.googlesource.com/c/go/+/176101 Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Austin Clements <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent fe67ce2 commit 1ea7644

File tree

5 files changed

+10
-19
lines changed

5 files changed

+10
-19
lines changed

src/cmd/vet/all/whitelist/android_arm.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/cmd/vet/all/whitelist/arm.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/cmd/vet/all/whitelist/linux_arm.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/runtime/stubs_arm.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44

55
package runtime
66

7-
// Stubs to pacify vet. Not safe to call from Go.
8-
// Calls to these functions are inserted by the compiler or assembler.
7+
// Called from compiler-generated code; declared for go vet.
98
func udiv()
109
func _div()
1110
func _divu()
1211
func _mod()
1312
func _modu()
13+
14+
// Called from assembly only; declared for go vet.
15+
func usplitR0()
16+
func load_g()
17+
func save_g()
18+
func emptyfunc()
19+
func _initcgo()
20+
func read_tls_fallback()

src/runtime/sys_linux_arm.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ TEXT runtime·clone(SB),NOSPLIT,$0
345345
MOVW $0, R5
346346

347347
// Copy mp, gp, fn off parent stack for use by child.
348-
// TODO(kaib): figure out which registers are clobbered by clone and avoid stack copying
349348
MOVW $-16(R1), R1
350349
MOVW mp+8(FP), R6
351350
MOVW R6, 0(R1)
@@ -366,6 +365,7 @@ TEXT runtime·clone(SB),NOSPLIT,$0
366365
RET
367366

368367
// Paranoia: check that SP is as we expect. Use R13 to avoid linker 'fixup'
368+
NOP R13 // tell vet SP/R13 changed - stop checking offsets
369369
MOVW 12(R13), R0
370370
MOVW $1234, R1
371371
CMP R0, R1

0 commit comments

Comments
 (0)