aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/consts.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-03-29 19:02:33 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-03-29 19:04:30 +0100
commitc35ee0ea6d7ad386409ff5092d11361169886eef (patch)
treefcf72b082516fa6881bd34bef0173d1a32e4f22a /pkg/compiler/consts.go
parentbabbf71b140500d52c982bead33f7575fc23ecab (diff)
prog, pkg/compiler: fix warnings
gometalinter says: pkg/compiler/consts.go:192::warning: internal error: no range for "n" (vetshadow) pkg/compiler/consts.go:197::warning: internal error: no range for "n" (vetshadow) prog/encoding.go:862::warning: declaration of "v" shadows declaration at prog/encoding.go:852 (vetshadow) This somehow happens only with Go1.11 but not 1.12 so wasn't detected locally. The prog warnings looks legit. The pkg/compiler warning was amusingly introduced to please golangci-lint checker, revert that fix for now.
Diffstat (limited to 'pkg/compiler/consts.go')
-rw-r--r--pkg/compiler/consts.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/compiler/consts.go b/pkg/compiler/consts.go
index e06319fb6..d3556c047 100644
--- a/pkg/compiler/consts.go
+++ b/pkg/compiler/consts.go
@@ -164,9 +164,10 @@ func (comp *compiler) assignSyscallNumbers(consts map[string]uint64) {
// Updates desc and returns set of unsupported syscalls and flags.
func (comp *compiler) patchConsts(consts map[string]uint64) {
for _, decl := range comp.desc.Nodes {
- switch n := decl.(type) {
+ switch decl.(type) {
case *ast.IntFlags:
// Unsupported flag values are dropped.
+ n := decl.(*ast.IntFlags)
var values []*ast.Int
for _, v := range n.Values {
if comp.patchIntConst(&v.Value, &v.Ident, consts, nil) {