compiler: fix crash on struct that embeds pointer type

The type verification code that enforces rules about the types of
embedded struct fields was not properly handling the case where the
pointed-to type is a pointer type, e.g.

  type s *struct{ C int }
  type t struct{ *s }

which is illegal according to the spec. Tweak the verifier to catch
this case, and add a guard in the lowering pass to make sure that we
don't crash on invalid accesses to field "C" in type "t" above.

Fixes golang/go#22050

Change-Id: I5d7bb0ddd603bdafb75a0382d23ca8956ac95698
Reviewed-on: https://go-review.googlesource.com/66530
Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 file changed