compiler: fix crash on struct that embeds pointer type
commit233557133c4c2db3f39b1bff7b8a7713523d43ab
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Sep 2017 17:46:33 +0000 (27 17:46 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Sep 2017 17:46:33 +0000 (27 17:46 +0000)
treec9d2a60d8775d143e4dd645a0f4d43ac10c46e7e
parent0a53d3c8f8380b51a6875e7155df48cc7ff11592
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

    Reviewed-on: https://go-review.googlesource.com/66530

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253236 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc