This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Don't crash on erroneous named type


This patch to the Go frontend fixes the generation of GENERIC from a
named type to remember when we have to create an erroneous type, so that
we don't get confused later because the result of a named type does not
actually have a name.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 6f027b4380e9 go/types.cc
--- a/go/types.cc	Wed Jan 19 12:46:26 2011 -0800
+++ b/go/types.cc	Wed Jan 19 12:51:02 2011 -0800
@@ -7085,7 +7085,10 @@
       this->named_tree_ = t;
       t = this->type_->struct_type()->fill_in_tree(gogo, t);
       if (t == error_mark_node)
-	return error_mark_node;
+	{
+	  this->named_tree_ = error_mark_node;
+	  return error_mark_node;
+	}
       break;
 
     case TYPE_ARRAY:
@@ -7120,7 +7123,10 @@
 	  this->named_tree_ = t;
 	  t = this->type_->interface_type()->fill_in_tree(gogo, t);
 	  if (t == error_mark_node)
-	    return error_mark_node;
+	    {
+	      this->named_tree_ = error_mark_node;
+	      return error_mark_node;
+	    }
 	}
       break;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]