@@ -28,25 +28,25 @@ func (w *walker) contains(n interface{}) bool {
28
28
return false
29
29
}
30
30
31
- func (w * walker ) walkRefs (ctx context.Context , depth int , v ssautil.Referrerer ) ([]string , bool ) {
32
- for _ , v := range * v .Referrers () {
33
- if r , ok := w .walk (ctx , depth , v ); ok {
31
+ func (w * walker ) walkRefs (ctx context.Context , v ssautil.Referrerer ) ([]string , bool ) {
32
+ for _ , v := range ssautil .Referrers (v ) {
33
+ if r , ok := w .walk (ctx , v ); ok {
34
34
return r , true
35
35
}
36
36
}
37
37
return nil , false
38
38
}
39
39
40
- func (w * walker ) walkOperands (ctx context.Context , depth int , v ssautil.Operander ) ([]string , bool ) {
40
+ func (w * walker ) walkOperands (ctx context.Context , v ssautil.Operander ) ([]string , bool ) {
41
41
for _ , v := range ssautil .Operands (v ) {
42
- if r , ok := w .walk (ctx , depth , v ); ok {
42
+ if r , ok := w .walk (ctx , v ); ok {
43
43
return r , true
44
44
}
45
45
}
46
46
return nil , false
47
47
}
48
48
49
- func (w * walker ) walk (ctx context.Context , depth int , v ssautil.Poser ) ([]string , bool ) {
49
+ func (w * walker ) walk (ctx context.Context , v ssautil.Poser ) ([]string , bool ) {
50
50
if w .contains (v ) {
51
51
return nil , false
52
52
}
@@ -55,17 +55,17 @@ func (w *walker) walk(ctx context.Context, depth int, v ssautil.Poser) ([]string
55
55
56
56
switch v := v .(type ) {
57
57
case * ssa.Slice :
58
- return w .walkOperands (ctx , depth + 1 , v )
58
+ return w .walkOperands (ctx , v )
59
59
case * ssa.Alloc :
60
- return w .walkRefs (ctx , depth + 1 , v )
60
+ return w .walkRefs (ctx , v )
61
61
case * ssa.IndexAddr :
62
- return w .walkRefs (ctx , depth + 1 , v )
62
+ return w .walkRefs (ctx , v )
63
63
case * ssa.Store :
64
- return w .walkOperands (ctx , depth + 1 , v )
64
+ return w .walkOperands (ctx , v )
65
65
case * ssa.ChangeInterface :
66
- return w .walkOperands (ctx , depth + 1 , v )
66
+ return w .walkOperands (ctx , v )
67
67
case * ssa.Extract :
68
- return w .walkOperands (ctx , depth + 1 , v )
68
+ return w .walkOperands (ctx , v )
69
69
case * ssa.Call :
70
70
return formatCall (ctx , v )
71
71
}
0 commit comments