diff mbox

Go patch committed: Don't get confused by mix of abstract types

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

Commit Message

Ian Lance Taylor Feb. 10, 2011, 9:46 p.m. UTC
The Go frontend could get confused when two different sorts of abstract
types (e.g., one integer and one float) were mixed together in a binary
expression which did not itself have any implied type.  The result could
be an abstract type in a context where that was not permitted.  This
patch fixes the problem.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r 50d121d61be6 go/expressions.cc
--- a/go/expressions.cc	Thu Feb 10 11:19:56 2011 -0800
+++ b/go/expressions.cc	Thu Feb 10 11:43:15 2011 -0800
@@ -5536,6 +5536,9 @@ 
 	subcontext.type = tright;
       else
 	subcontext.type = tleft;
+
+      if (subcontext.type != NULL && !context->may_be_abstract)
+	subcontext.type = subcontext.type->make_non_abstract_type();
     }
 
   this->left_->determine_type(&subcontext);