diff mbox

Go patch committed: Don't patch if type was not converted

Message ID mcr7hcg3dfn.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor March 3, 2011, 6:50 a.m. UTC
This patch to the Go frontend avoids a crash if an erroneous type was
not converted to GENERIC.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r afb3d3196225 go/types.cc
--- a/go/types.cc	Wed Mar 02 22:39:25 2011 -0800
+++ b/go/types.cc	Wed Mar 02 22:46:54 2011 -0800
@@ -7300,7 +7300,12 @@ 
 
   // 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.