]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vet: fix go vet on parentheses of assembly function flag
authorWei Xiao <wei.xiao@arm.com>
Mon, 11 Sep 2017 07:59:30 +0000 (07:59 +0000)
committerRob Pike <r@golang.org>
Wed, 13 Sep 2017 03:18:07 +0000 (03:18 +0000)
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: Rob Pike <r@golang.org>
src/cmd/vet/all/whitelist/386.txt
src/cmd/vet/all/whitelist/amd64.txt
src/cmd/vet/all/whitelist/arm.txt
src/cmd/vet/all/whitelist/arm64.txt
src/cmd/vet/all/whitelist/mips64x.txt
src/cmd/vet/all/whitelist/mipsx.txt
src/cmd/vet/all/whitelist/nacl_amd64p32.txt
src/cmd/vet/all/whitelist/s390x.txt
src/cmd/vet/asmdecl.go

index 33b63e19ba5c0cc46d56ce3c84920beaa58d0516..5a6bde90c2828af1349baf658fd5b9186378d4e4 100644 (file)
@@ -3,8 +3,6 @@
 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/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 8(SP) points beyond argument frame
 runtime/asm_386.s: [386] morestack: use of 4(SP) points beyond argument frame
index fb617d5554040f9664105913b25824c5d09abffb..56a6e2eb8d90c8155c868778e298e24f82e2045c 100644 (file)
@@ -5,8 +5,6 @@
 
 
 // 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 16(SP) points beyond argument frame
 runtime/asm_amd64.s: [amd64] morestack: use of 8(SP) points beyond argument frame
index c0ab9de67d02c94c03d0955e858e300385e0bb02..3560afec7b82b192c8d17001a19049b8acc6d949 100644 (file)
@@ -3,8 +3,6 @@
 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/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
 
 // Intentionally missing declarations.
index 8a3c891a70fecd7160832da38032b71fd01edbeb..24fc6f42235f9bfd74e387f590fceea6979aeb30 100644 (file)
@@ -2,12 +2,6 @@
 
 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.
 runtime/asm_arm64.s: [arm64] abort: function abort missing Go declaration
 runtime/asm_arm64.s: [arm64] addmoduledata: function addmoduledata missing Go declaration
index b29cf3e43cc94c6eb024f0833064a4be43e61075..5354d21c6428f628fa12c73c99e9eea34258ae4b 100644 (file)
@@ -1,7 +1,5 @@
 // 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/duff_mips64x.s: [GOARCH] duffzero: function duffzero missing Go declaration
 runtime/tls_mips64x.s: [GOARCH] save_g: function save_g missing Go declaration
index 949a1b366ff8afa3d264a7642e3bafa62ba5b73c..860f8399211076c1bff473a5770d11d1cccf22af 100644 (file)
@@ -1,7 +1,5 @@
 // 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/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
index 83bcfe966e68b5862cb828479e114295eb627b56..4b2aad2aacd9305464d426c0489433206f301881 100644 (file)
@@ -1,8 +1,6 @@
 // nacl/amd64p32-specific vet whitelist. See readme.txt for details.
 
 // 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 16(SP) points beyond argument frame
 runtime/asm_amd64p32.s: [amd64p32] morestack: use of 8(SP) points beyond argument frame
index 875835e01e38f7dc187e1e48524bfffaa82b526b..f18236c4f112dee1c1fdf7e68d40eb2560de4218 100644 (file)
@@ -1,5 +1,3 @@
-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] memeqbody: function memeqbody missing Go declaration
 runtime/asm_s390x.s: [s390x] memeqbodyclc: function memeqbodyclc missing Go declaration
index 7882112a51d8cd7a471d7bc957c6a2a168fdde40..b01d23d342ba5372f2c06ffbf829ab2e5d8bc1dc 100644 (file)
@@ -109,7 +109,7 @@ func init() {
 var (
        re           = regexp.MustCompile
        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`)
        asmNamedFP   = re(`([a-zA-Z0-9_\xFF-\x{10FFFF}]+)(?:\+([0-9]+))\(FP\)`)
        asmUnnamedFP = re(`[^+\-0-9](([0-9]+)\(FP\))`)