compiler: don't crash if imported package imports this one

When building a test it's OK if test code imports a package that
imports this one. The go tool is supposed to catch cases where this
creates an impossible initialization order. The compiler already has
code to permit this in Gogo::add_import_init_fn. This CL avoids a
compiler crash on a similar case when writing out the export data.

I have no test case for this. Basically it pushes a compiler crash
into an error reported elsewhere.

Problem was reported by Tony Reix.

Change-Id: Ic0a79e2cb0ee05ee11bc3b94f6532ed308244b6b
Reviewed-on: https://go-review.googlesource.com/38462
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Matthieu Sarter <matthieu.sarter.external@atos.net>
1 file changed