From: Ian Lance Taylor Date: Thu, 3 Mar 2011 06:50:32 +0000 (+0000) Subject: Don't crash if erroneous type was not converted. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7a10f0d78147f8fb1391474b76202ca37b0c998;p=gcc.git Don't crash if erroneous type was not converted. From-SVN: r170646 --- diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 27104081df4..0db599441dd 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -7300,7 +7300,12 @@ Named_type::do_get_tree(Gogo* gogo) // We are not converting types. This should only be called if the // type has already been converted. - gcc_assert(this->is_converted_); + if (!this->is_converted_) + { + gcc_assert(saw_errors()); + return error_mark_node; + } + gcc_assert(t != NULL_TREE && TYPE_SIZE(t) != NULL_TREE); // Complete the tree.