compiler: avoid crashing on bad self-referential type
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 1 Mar 2018 19:56:14 +0000 (19:56 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 1 Mar 2018 19:56:14 +0000 (19:56 +0000)
commit56fc943329299ed3b53ddefd9bcdec997ee9cc71
tree642557ee91807bd6032e46f1e207e9ca9f92ddb7
parenteedaaaf7d7892011245b1e2054ca917c6d81c213
compiler: avoid crashing on bad self-referential type

    The compiler was crashing partway through emitting an error for a bad
    self-referential struct type (which refers to one of its own fields
    via an unsafe.Offset expression). Tweak the offset logic to check for
    this class of type error and exit cleanly.

    Fixes golang/go#24180

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

From-SVN: r258112
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc