From f7a10f0d78147f8fb1391474b76202ca37b0c998 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 3 Mar 2011 06:50:32 +0000 Subject: [PATCH] Don't crash if erroneous type was not converted. From-SVN: r170646 --- gcc/go/gofrontend/types.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. -- 2.30.2