Go patch committed: Don't get confused by error types in traversal

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

Commit Message

Ian Taylor Dec. 15, 2010, 1:05 a.m.
This patch fixes the Go frontend to not get confused by error types when
doing a traversal.  Previously once an error type had been seen, the
frontend would think that all subsequent types had been seen, because to
avoid knock-on type compatibility error messages the error type is
considered to be identical to all other types.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.



diff -r 8c9b70be1f8c go/gogo.cc
--- a/go/gogo.cc	Tue Dec 14 16:08:09 2010 -0800
+++ b/go/gogo.cc	Tue Dec 14 17:00:35 2010 -0800
@@ -4201,6 +4201,8 @@ 
 Traverse::remember_type(const Type* type)
+  if (type->is_error_type())
+    return true;
   gcc_assert((this->traverse_mask() & traverse_types) != 0
 	     || (this->traverse_mask() & traverse_expressions) != 0);
   // We only have to remember named types, as they are the only ones