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

login
register
mail settings
Submitter Ian Taylor
Date Dec. 15, 2010, 1:05 a.m.
Message ID <mcrr5dj6e29.fsf@google.com>
Download mbox | patch
Permalink /patch/75592/
State New
Headers show

Comments

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.

Ian

Patch

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 @@ 
 bool
 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