Don't crash if erroneous type was not converted.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 3 Mar 2011 06:50:32 +0000 (06:50 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 3 Mar 2011 06:50:32 +0000 (06:50 +0000)
From-SVN: r170646

gcc/go/gofrontend/types.cc

index 27104081df41628ace51ccb06ce5a058046a480c..0db599441dd5336cd5fb0955e177fb1adf75d8a4 100644 (file)
@@ -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.