Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/types, types2: stack overflow in hasVarSize for invalid generic type #52915

Closed
findleyr opened this issue May 15, 2022 · 1 comment
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@findleyr
Copy link
Contributor

Similar to #48819, the following invalid generic type declaration causes an infinite recursion in hasVarSize, when computing unsafe.Sizeof.

type T[P any] struct {
	T[P]
}

func _() {
	_ = unsafe.Sizeof(T[int]{})
}

https://go.dev/play/p/T5qCKxz69bk

CC @griesemer

@findleyr findleyr added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 15, 2022
@findleyr findleyr added this to the Go1.19 milestone May 15, 2022
@griesemer griesemer self-assigned this May 15, 2022
@gopherbot
Copy link

Change https://go.dev/cl/406849 mentions this issue: types2: don't panic with invalid recursive generic type

@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants