Patchwork Go patch committed: Fix determination of complex argument types

login
register
mail settings
Submitter Ian Taylor
Date Sept. 22, 2012, 6:02 a.m.
Message ID <mcrsjaaoar3.fsf@google.com>
Download mbox | patch
Permalink /patch/186095/
State New
Headers show

Comments

Ian Taylor - Sept. 22, 2012, 6:02 a.m.
This patch to the Go frontend fixes a dumb error that was preventing the
correct determination of argument types to the builtin complex function.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline and 4.7 branch.

Ian

Patch

diff -r 293c1db1ef35 go/expressions.cc
--- a/go/expressions.cc	Fri Sep 21 18:14:07 2012 -0700
+++ b/go/expressions.cc	Fri Sep 21 23:00:15 2012 -0700
@@ -7476,7 +7476,7 @@ 
 	if (args != NULL && args->size() == 2)
 	  {
 	    Type* t1 = args->front()->type();
-	    Type* t2 = args->front()->type();
+	    Type* t2 = args->back()->type();
 	    if (!t1->is_abstract())
 	      arg_type = t1;
 	    else if (!t2->is_abstract())