Go patch committed: Fix determination of complex argument types

Submitted by Ian Taylor on Sept. 22, 2012, 6:02 a.m.

Details

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

Commit Message

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 hide | download patch | download mbox

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())