We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 015671e commit 9dee6bdCopy full SHA for 9dee6bd
nilerr.go
@@ -67,13 +67,16 @@ func run(pass *analysis.Pass) (any, error) {
67
return nil, nil
68
}
69
70
+// getValueLineNumbers returns the line numbers.
71
+// `seen` is used to avoid infinite loop.
72
func getValueLineNumbers(pass *analysis.Pass, v ssa.Value, seen map[string]struct{}) []int {
73
if phi, ok := v.(*ssa.Phi); ok {
74
result := make([]int, 0, len(phi.Edges))
75
76
for _, edge := range phi.Edges {
77
if _, ok := seen[edge.Name()]; ok {
78
if edge.Pos() == token.NoPos {
79
+ // Skip elements without a position.
80
continue
81
82
0 commit comments