Skip to content

x/tools/gopls: Definition: out-of-bounds panic #73797

Closed
@adonovan

Description

@adonovan
#!stacks
"runtime.goPanicIndex:+2" && "Definition:+107"

Issue created by stacks.

	case token.BREAK, token.CONTINUE:
			// Find innermost relevant ancestor for break/continue.
			for i, n := range path[1:] {
				if isLabeled {
					l, ok := path[1:][i+1].(*ast.LabeledStmt) <--- panic (on last iteration of range loop, i+1 is OOB)
					if !(ok && l.Label.Name == label.Name()) {
						continue
					}
				}

This stack ChWbnw was reported by telemetry:

golang.org/x/tools/[email protected] go1.23.6 windows/amd64 vscode (2)

Metadata

Metadata

Assignees

Labels

NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/telemetry-wins

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions