]> Cypherpunks.ru repositories - gostls13.git/commit
go/parser: fix panic in object resolution for invalid type parameter list
authorRobert Griesemer <gri@golang.org>
Fri, 8 Dec 2023 05:08:17 +0000 (21:08 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 8 Dec 2023 20:07:50 +0000 (20:07 +0000)
commite1cba47ee06d59751e09fc8777ee9c57211018a5
tree59a091045f641fa0b36e4224ad03b7ae47f958e0
parent6cdf2ccae8a30b20c82bf01e7989f0971d1a4764
go/parser: fix panic in object resolution for invalid type parameter list

This change restores the original logic in parseParameterList to what
it was before CL 538858 (which caused the issue), not in exact wording
but in identical semantic meaning, and thus restores this function to
a state that we know was working fine.

However, the change keeps the improved error reporting introduced by
CL 538858. To keep the code changes somewhat minimal as we are close
to RC1, the improved error handling exists twice for now even though
it could be factored out.

Fixes #64534.

Change-Id: I0b7bbf74d28811e8aae74f838f2d424f78af1f38
Reviewed-on: https://go-review.googlesource.com/c/go/+/548395
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/go/parser/parser.go
src/go/parser/testdata/issue64534.src [new file with mode: 0644]