From 016569f204ed1c1060778b03ecacb33bc882d69a Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 28 Feb 2017 11:02:08 -0800 Subject: [PATCH] cmd/vet/all: move suspicious shift whitelists to 64 bit This is an inconsequential consequence of updating math/big to use math/bits. Better would be to teach the vet shift test to size int/uint/uintptr to the platform in use, eliminating the whole category of "might be too small". Filed #19321 for that. Change-Id: I7e0b837bd329132d7a564468c18502dd2e724fc6 Reviewed-on: https://go-review.googlesource.com/37576 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Brad Fitzpatrick --- src/cmd/vet/all/whitelist/64bit.txt | 15 +++++++++++++++ src/cmd/vet/all/whitelist/all.txt | 17 ----------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/cmd/vet/all/whitelist/64bit.txt b/src/cmd/vet/all/whitelist/64bit.txt index 35b9eb3ed05..b2c8e05b599 100644 --- a/src/cmd/vet/all/whitelist/64bit.txt +++ b/src/cmd/vet/all/whitelist/64bit.txt @@ -11,3 +11,18 @@ runtime/hashmap.go: hash might be too small for shift of 56 runtime/hashmap.go: hash might be too small for shift of 56 runtime/hashmap_fast.go: hash might be too small for shift of 56 runtime/hashmap_fast.go: hash might be too small for shift of 56 +math/big/arith.go: x might be too small for shift of 32 +math/big/arith.go: y might be too small for shift of 32 +math/big/arith.go: w0 might be too small for shift of 32 +math/big/arith.go: t might be too small for shift of 32 +math/big/arith.go: w1 might be too small for shift of 32 +math/big/arith.go: v might be too small for shift of 32 +math/big/arith.go: un10 might be too small for shift of 32 +math/big/arith.go: (xi&yi | (xi|yi)&^zi) might be too small for shift of 63 +math/big/arith.go: (yi&^xi | (yi|^xi)&zi) might be too small for shift of 63 +math/big/arith.go: xi &^ zi might be too small for shift of 63 +math/big/arith.go: (zi &^ xi) might be too small for shift of 63 +math/big/nat.go: t too small for shift of 64 +math/big/nat.go: x too small for shift of 64 +math/big/nat.go: yi might be too small for shift of 60 +math/big/nat.go: yi might be too small for shift of 60 diff --git a/src/cmd/vet/all/whitelist/all.txt b/src/cmd/vet/all/whitelist/all.txt index 97e121813bf..3a154e9d235 100644 --- a/src/cmd/vet/all/whitelist/all.txt +++ b/src/cmd/vet/all/whitelist/all.txt @@ -52,25 +52,8 @@ encoding/xml/read_test.go: method UnmarshalXML(d *Decoder, start StartElement) e // Mostly code that uses clever const tricks to determine // or use the size of an int or pointer (and related values). image/png/paeth.go: x might be too small for shift of 63 -math/big/arith.go: x might be too small for shift of 32 -math/big/arith.go: y might be too small for shift of 32 -math/big/arith.go: w0 might be too small for shift of 32 -math/big/arith.go: t might be too small for shift of 32 -math/big/arith.go: w1 might be too small for shift of 32 -math/big/arith.go: v might be too small for shift of 32 -math/big/arith.go: un10 might be too small for shift of 32 -math/big/arith.go: (xi&yi | (xi|yi)&^zi) might be too small for shift of 63 -math/big/arith.go: (yi&^xi | (yi|^xi)&zi) might be too small for shift of 63 -math/big/arith.go: xi &^ zi might be too small for shift of 63 -math/big/arith.go: (zi &^ xi) might be too small for shift of 63 math/big/float.go: x[i] might be too small for shift of 32 -math/big/nat.go: t too small for shift of 64 -math/big/nat.go: x too small for shift of 64 -math/big/nat.go: ((x & -x) * (deBruijn64 & _M)) might be too small for shift of 58 math/big/nat.go: Word(rand.Uint32()) might be too small for shift of 32 -math/big/nat.go: yi might be too small for shift of 60 -math/big/nat.go: yi might be too small for shift of 60 -runtime/cpuprof.go: h might be too small for shift of 56 runtime/malloc.go: uintptr(i) might be too small for shift of 40 runtime/malloc.go: uintptr(i) might be too small for shift of 40 runtime/malloc.go: uintptr(i) might be too small for shift of 40