1
0

Updated staticcheck

This commit is contained in:
kolaente
2019-04-22 12:59:42 +02:00
parent 5dc1fd0f86
commit 99f83542f6
34 changed files with 6144 additions and 2537 deletions

View File

@ -39,3 +39,20 @@ func Walk(b *ssa.BasicBlock, fn func(*ssa.BasicBlock) bool) {
wl = append(wl, b.Succs...)
}
}
func Vararg(x *ssa.Slice) ([]ssa.Value, bool) {
var out []ssa.Value
slice, ok := x.X.(*ssa.Alloc)
if !ok || slice.Comment != "varargs" {
return nil, false
}
for _, ref := range *slice.Referrers() {
idx, ok := ref.(*ssa.IndexAddr)
if !ok {
continue
}
v := (*idx.Referrers())[0].(*ssa.Store).Val
out = append(out, v)
}
return out, true
}