#!stacks
"gopanic" && "golang.org/x/tools/go/ast/inspector.(*visitor).push:+24"

Issue created by stacks.

func (v *visitor) push(ek edge.Kind, eindex int, node ast.Node) {
    ...
    // 32M elements in an []ast.Node ought to be enough for anyone!
    if ek2, eindex2 := unpackEdgeKindAndIndex(packEdgeKindAndIndex(ek, eindex)); ek2 != ek || eindex2 != eindex {
        panic("Node slice index exceeded uint25")
    }
}

This stack dYd0DQ was reported by telemetry:

golang.org/x/tools/gopls@v0.19.1 go1.24.4 windows/amd64 other,vscode-insiders (6)

Comment From: adonovan

The crash is trivial to reproduce by loading the output of this program into gopls:

    fmt.Println(`package p; var _ = []int{`)
    fmt.Println(strings.Repeat("0,", 1<<25))
    fmt.Println(`}`)

Not sure how to fix it, nor whether fixing it should be a priority. Fixing the code generator would be a better solution.

Comment From: gabyhelp

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)