diff mbox

Go patch committed: Don't crash on ref to field with error type

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

Commit Message

Ian Lance Taylor Jan. 19, 2011, 8:47 p.m. UTC
This patch to the Go frontend fixes a compiler crash on a reference to a
field with an erroneous type.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r 53bc433c6929 go/expressions.cc
--- a/go/expressions.cc	Wed Jan 19 12:35:44 2011 -0800
+++ b/go/expressions.cc	Wed Jan 19 12:45:34 2011 -0800
@@ -9988,6 +9988,8 @@ 
       field = DECL_CHAIN(field);
       gcc_assert(field != NULL_TREE);
     }
+  if (TREE_TYPE(field) == error_mark_node)
+    return error_mark_node;
   return build3(COMPONENT_REF, TREE_TYPE(field), struct_tree, field,
 		NULL_TREE);
 }