This patch by Chris Manghane fixes the Go frontend to not crash on
erroneous array types.  This fixes https://golang.org/issue/11546 .
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 227160)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-81810917af7ba19e1f9f8efc8b1989f7d6419d30
+d6d59d5927c4ea0c02468ebc6a2df431fb64595a
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: gcc/go/gofrontend/types.cc
===================================================================
--- gcc/go/gofrontend/types.cc  (revision 226846)
+++ gcc/go/gofrontend/types.cc  (working copy)
@@ -5781,6 +5781,8 @@ Array_type::verify_length()
 bool
 Array_type::do_verify()
 {
+  if (this->element_type()->is_error_type())
+    return false;
   if (!this->verify_length())
     this->length_ = Expression::make_error(this->length_->location());
   return true;

Reply via email to