Fix #130: update ineffassign: fix crash on break/continue outside of loop
This commit is contained in:
parent
b900926bfc
commit
0262f00bfb
4
Gopkg.lock
generated
4
Gopkg.lock
generated
@ -157,11 +157,11 @@
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:55b1295e893690bce0d5952101bf21b3ce28a32bd3625007104068b76646e842"
|
||||
digest = "1:3a5ea92f78579dfd319260ce995575c07890c8aff429035637287a00da664647"
|
||||
name = "github.com/golangci/ineffassign"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "7b41b0f84881918dab3c16c5e5148d8aa55d27b4"
|
||||
revision = "2ee8f2867dde308c46d401d6d30f6c644094b167"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
|
6
vendor/github.com/golangci/ineffassign/ineffassign.go
generated
vendored
6
vendor/github.com/golangci/ineffassign/ineffassign.go
generated
vendored
@ -505,6 +505,12 @@ func (s *branchStack) get(lbl *ast.Ident) *branch {
|
||||
return br
|
||||
}
|
||||
}
|
||||
|
||||
// Guard against invalid code (break/continue outside of loop).
|
||||
if lbl == nil {
|
||||
return &branch{}
|
||||
}
|
||||
|
||||
return s.push(lbl.Obj)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user