-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/compile: crash during import #15548
Comments
cc @robpike |
I0 isn't used anywhere. Can it be removed and still trigger the crash? |
In a standard go workspace, the files would be laid out
So a.go's "./c" import would import a different package than b/b.go's "./c" import. Does bimport need to know that when it's loading a package for "x/y" and it sees a reference to a package "./z", that we need to rewrite it to "x/y/z"? |
I believe the code is correct. The issue is the type equality check in That is, the fix is to delay the check. I think if you comment out the
|
CL https://golang.org/cl/22803 mentions this issue. |
CL https://golang.org/cl/22839 mentions this issue. |
The new export format keeps track of all types that are exported. If a type is seen that was exported before, only a reference to that type is emitted. The importer maintains a list of all the seen types and uses that list to resolve type references. The existing compiler infrastructure's invariants assumes that only named types are referred to before they are fully set up. Referring to unnamed incomplete types causes problems. One of the issues was #15548. Added a new internal flag 'trackAllTypes' to enable/disable this type tracking. With this change only named types are tracked. Verified that this fix also addresses #15548, even w/o the prior fix for that issue (in fact that prior fix is turned off if trackAllTypes is disabled because it's not needed). The test for #15548 covers also this change. For #15548. Change-Id: Id0b3ff983629703d025a442823f99649fd728a56 Reviewed-on: https://go-review.googlesource.com/22839 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Given the files
a.go:
b.go:
c.go:
The compile
dies in import:
The text was updated successfully, but these errors were encountered: