Commit 701d4924 authored by Wei Xiao's avatar Wei Xiao Committed by Rob Pike

cmd/vet: fix go vet on parentheses of assembly function flag

Current implementation doesn't recognize parentheses that may appear in flags
of assembly function as shown below:

	TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$24

It results in vet reporting false positives and a lot of whitelists are added
for suppressing the false alarms.

This CL fixes the issue and eliminates the redundant whitelists.

Change-Id: Idbc1b42965b31cea8ee7c23d1a6f62feb68e844c
Reviewed-on: https://go-review.googlesource.com/62850
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent 9f1a7192
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: Compare is in package bytes runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: Compare is in package bytes
// reflect trampolines intentionally omit arg size. Same for morestack. // reflect trampolines intentionally omit arg size. Same for morestack.
reflect/asm_386.s: [386] makeFuncStub: use of 4(SP) points beyond argument frame
reflect/asm_386.s: [386] methodValueCall: use of 4(SP) points beyond argument frame
runtime/asm_386.s: [386] morestack: use of 4(SP) points beyond argument frame runtime/asm_386.s: [386] morestack: use of 4(SP) points beyond argument frame
runtime/asm_386.s: [386] morestack: use of 8(SP) points beyond argument frame runtime/asm_386.s: [386] morestack: use of 8(SP) points beyond argument frame
runtime/asm_386.s: [386] morestack: use of 4(SP) points beyond argument frame runtime/asm_386.s: [386] morestack: use of 4(SP) points beyond argument frame
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
// reflect trampolines intentionally omit arg size. Same for morestack. // reflect trampolines intentionally omit arg size. Same for morestack.
reflect/asm_amd64.s: [amd64] makeFuncStub: use of 8(SP) points beyond argument frame
reflect/asm_amd64.s: [amd64] methodValueCall: use of 8(SP) points beyond argument frame
runtime/asm_amd64.s: [amd64] morestack: use of 8(SP) points beyond argument frame runtime/asm_amd64.s: [amd64] morestack: use of 8(SP) points beyond argument frame
runtime/asm_amd64.s: [amd64] morestack: use of 16(SP) points beyond argument frame runtime/asm_amd64.s: [amd64] morestack: use of 16(SP) points beyond argument frame
runtime/asm_amd64.s: [amd64] morestack: use of 8(SP) points beyond argument frame runtime/asm_amd64.s: [amd64] morestack: use of 8(SP) points beyond argument frame
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: Compare is in package bytes runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: Compare is in package bytes
// reflect trampolines intentionally omit arg size. Same for morestack. // reflect trampolines intentionally omit arg size. Same for morestack.
reflect/asm_arm.s: [arm] makeFuncStub: use of 8(R13) points beyond argument frame
reflect/asm_arm.s: [arm] methodValueCall: use of 8(R13) points beyond argument frame
runtime/asm_arm.s: [arm] morestack: use of 4(R13) points beyond argument frame runtime/asm_arm.s: [arm] morestack: use of 4(R13) points beyond argument frame
// Intentionally missing declarations. // Intentionally missing declarations.
......
...@@ -2,12 +2,6 @@ ...@@ -2,12 +2,6 @@
runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: Compare is in package bytes runtime/asm_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: Compare is in package bytes
// False positives.
// reflect trampolines intentionally omit arg size. Same for morestack.
reflect/asm_arm64.s: [arm64] makeFuncStub: use of 16(RSP) points beyond argument frame
reflect/asm_arm64.s: [arm64] methodValueCall: use of 16(RSP) points beyond argument frame
// Intentionally missing declarations. // Intentionally missing declarations.
runtime/asm_arm64.s: [arm64] abort: function abort missing Go declaration runtime/asm_arm64.s: [arm64] abort: function abort missing Go declaration
runtime/asm_arm64.s: [arm64] addmoduledata: function addmoduledata missing Go declaration runtime/asm_arm64.s: [arm64] addmoduledata: function addmoduledata missing Go declaration
......
// mips64-specific vet whitelist. See readme.txt for details. // mips64-specific vet whitelist. See readme.txt for details.
reflect/asm_mips64x.s: [GOARCH] makeFuncStub: use of 16(R29) points beyond argument frame
reflect/asm_mips64x.s: [GOARCH] methodValueCall: use of 16(R29) points beyond argument frame
runtime/asm_mips64x.s: [GOARCH] abort: function abort missing Go declaration runtime/asm_mips64x.s: [GOARCH] abort: function abort missing Go declaration
runtime/duff_mips64x.s: [GOARCH] duffzero: function duffzero missing Go declaration runtime/duff_mips64x.s: [GOARCH] duffzero: function duffzero missing Go declaration
runtime/tls_mips64x.s: [GOARCH] save_g: function save_g missing Go declaration runtime/tls_mips64x.s: [GOARCH] save_g: function save_g missing Go declaration
......
// mips64-specific vet whitelist. See readme.txt for details. // mips64-specific vet whitelist. See readme.txt for details.
reflect/asm_mipsx.s: [GOARCH] makeFuncStub: use of 8(R29) points beyond argument frame
reflect/asm_mipsx.s: [GOARCH] methodValueCall: use of 8(R29) points beyond argument frame
runtime/asm_mipsx.s: [GOARCH] abort: function abort missing Go declaration runtime/asm_mipsx.s: [GOARCH] abort: function abort missing Go declaration
runtime/tls_mipsx.s: [GOARCH] save_g: function save_g missing Go declaration runtime/tls_mipsx.s: [GOARCH] save_g: function save_g missing Go declaration
runtime/tls_mipsx.s: [GOARCH] load_g: function load_g missing Go declaration runtime/tls_mipsx.s: [GOARCH] load_g: function load_g missing Go declaration
......
// nacl/amd64p32-specific vet whitelist. See readme.txt for details. // nacl/amd64p32-specific vet whitelist. See readme.txt for details.
// reflect trampolines intentionally omit arg size. Same for morestack. // reflect trampolines intentionally omit arg size. Same for morestack.
reflect/asm_amd64p32.s: [amd64p32] makeFuncStub: use of 4(SP) points beyond argument frame
reflect/asm_amd64p32.s: [amd64p32] methodValueCall: use of 4(SP) points beyond argument frame
runtime/asm_amd64p32.s: [amd64p32] morestack: use of 8(SP) points beyond argument frame runtime/asm_amd64p32.s: [amd64p32] morestack: use of 8(SP) points beyond argument frame
runtime/asm_amd64p32.s: [amd64p32] morestack: use of 16(SP) points beyond argument frame runtime/asm_amd64p32.s: [amd64p32] morestack: use of 16(SP) points beyond argument frame
runtime/asm_amd64p32.s: [amd64p32] morestack: use of 8(SP) points beyond argument frame runtime/asm_amd64p32.s: [amd64p32] morestack: use of 8(SP) points beyond argument frame
......
reflect/asm_s390x.s: [s390x] makeFuncStub: use of 16(R15) points beyond argument frame
reflect/asm_s390x.s: [s390x] methodValueCall: use of 16(R15) points beyond argument frame
runtime/asm_s390x.s: [s390x] abort: function abort missing Go declaration runtime/asm_s390x.s: [s390x] abort: function abort missing Go declaration
runtime/asm_s390x.s: [s390x] memeqbody: function memeqbody missing Go declaration runtime/asm_s390x.s: [s390x] memeqbody: function memeqbody missing Go declaration
runtime/asm_s390x.s: [s390x] memeqbodyclc: function memeqbodyclc missing Go declaration runtime/asm_s390x.s: [s390x] memeqbodyclc: function memeqbodyclc missing Go declaration
......
...@@ -109,7 +109,7 @@ func init() { ...@@ -109,7 +109,7 @@ func init() {
var ( var (
re = regexp.MustCompile re = regexp.MustCompile
asmPlusBuild = re(`//\s+\+build\s+([^\n]+)`) asmPlusBuild = re(`//\s+\+build\s+([^\n]+)`)
asmTEXT = re(`\bTEXT\b(.*)·([^\(]+)\(SB\)(?:\s*,\s*([0-9A-Z|+]+))?(?:\s*,\s*\$(-?[0-9]+)(?:-([0-9]+))?)?`) asmTEXT = re(`\bTEXT\b(.*)·([^\(]+)\(SB\)(?:\s*,\s*([0-9A-Z|+()]+))?(?:\s*,\s*\$(-?[0-9]+)(?:-([0-9]+))?)?`)
asmDATA = re(`\b(DATA|GLOBL)\b`) asmDATA = re(`\b(DATA|GLOBL)\b`)
asmNamedFP = re(`([a-zA-Z0-9_\xFF-\x{10FFFF}]+)(?:\+([0-9]+))\(FP\)`) asmNamedFP = re(`([a-zA-Z0-9_\xFF-\x{10FFFF}]+)(?:\+([0-9]+))\(FP\)`)
asmUnnamedFP = re(`[^+\-0-9](([0-9]+)\(FP\))`) asmUnnamedFP = re(`[^+\-0-9](([0-9]+)\(FP\))`)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment