Skip to content

go/parser: panic during object resolution: identifier already declared #64534

@findleyr

Description

@findleyr

Discovered via Google internal bug reporting, and reproduced via fuzzing.

The following code panics in object resolution:

	_, err := parser.ParseFile(token.NewFileSet(), "", "package p; func _[A\x9d(B](){}", 0)

Output:

panic: 1:22: identifier B already declared or resolved [recovered]
	panic: 1:22: identifier B already declared or resolved

https://go.dev/play/p/SacseHmo6ha?v=gotip

This is a new regression, and does not reproduce at 1.21. Marking as a release blocker.
The only thing that changed is https://go.dev/cl/538858, though I don't immediately see the bug.

CC @griesemer @adonovan

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions