-
Notifications
You must be signed in to change notification settings - Fork 18k
gccgo: internal compiler error with cyclic function declaration (esoteric) #25680
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
I hope that program is not valid Go. |
I don't think it is. But it probably shouldn't crash. But certainly not important in any case. Just reporting another test case for the cycle test suite... |
It isn't. Array lengths are defined as follows:
Since |
Change https://golang.org/cl/115796 mentions this issue: |
This patch fixes type traversal to avoid compiler crashes for test cases where a type T includes an expression that refers back to the type without actually explicitly mentioning T. Examples include var x [uintptr(unsafe.Sizeof(&x))]byte var a [len(a)]int The fix involves expanding the set of types that the traversal code "remembers" (to avoid cycles) to include array types, and introducing an additional guard in Builtin_call_expression::do_is_constant to catch cyclic type constructs. Fixes golang/go#25299 Fixes golang/go#25679 Fixes golang/go#25315 Fixes golang/go#25680 Reviewed-on: https://go-review.googlesource.com/115796 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261168 138bc75d-0d04-0410-961f-82ee72b054a4
This patch fixes type traversal to avoid compiler crashes for test cases where a type T includes an expression that refers back to the type without actually explicitly mentioning T. Examples include var x [uintptr(unsafe.Sizeof(&x))]byte var a [len(a)]int The fix involves expanding the set of types that the traversal code "remembers" (to avoid cycles) to include array types, and introducing an additional guard in Builtin_call_expression::do_is_constant to catch cyclic type constructs. Fixes golang/go#25299 Fixes golang/go#25679 Fixes golang/go#25315 Fixes golang/go#25680 Reviewed-on: https://go-review.googlesource.com/115796 From-SVN: r261168
With
compiling the following program:
leads to an internal compiler error:
cc: @thanm
The text was updated successfully, but these errors were encountered: