-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types, types2: stack overflow in hasVarSize for invalid type #48819
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
Comments
This is actually a regression in 1.17: crashes in |
Bisected to https://golang.org/cl/284254, which makes sense. We can fix this case, but reconsidering the change in https://golang.org/cl/284254, I wonder if it resulted in any other similar crashers (or broke any uses of go/types). |
|
@griesemer do you think this is worthy of a back-port to 1.17? I'm not sure. It seems rare, but the behavior change with respect to |
Change https://golang.org/cl/354349 mentions this issue: |
Change https://golang.org/cl/354329 mentions this issue: |
This is a clean port of CL 354329 from types2 to go/types. For #48819. Change-Id: I9efdcdbfa6432f3cee64d924a4c67ecc6793cf86 Reviewed-on: https://go-review.googlesource.com/c/go/+/354349 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
@gopherbot please consider this for backport to 1.17, it's a regression. |
Backport issue(s) opened: #48825 (for 1.17). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/368456 mentions this issue: |
This is a partial port of CL 354329 from types2 to go/types. It contains an adjustment to type.go to deal with possibly invalid type bounds. Fixes #48825. For #48819. Change-Id: I9efdcdbfa6432f3cee64d924a4c67ecc6793cf86 Reviewed-on: https://go-review.googlesource.com/c/go/+/354349 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/368456 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
With type parameters, the results of
unsafe.Sizeof
may be variable. The logic to check this needs to be defensive against invalid types. Type checking the following code currently results in a stack overflow:CC @griesemer
The text was updated successfully, but these errors were encountered: