]> Cypherpunks repositories - gostls13.git/commitdiff
fix error converting result of complex
authorKen Thompson <ken@golang.org>
Wed, 10 Nov 2010 01:39:36 +0000 (17:39 -0800)
committerKen Thompson <ken@golang.org>
Wed, 10 Nov 2010 01:39:36 +0000 (17:39 -0800)
division. resolves issue 1261.

R=rsc
CC=golang-dev
https://golang.org/cl/2985043

src/cmd/gc/walk.c

index 68c5e84ef8515cb160cc834e979b1391d2095ed3..315319a328994fb8114f50f661b8e5e2477f81b2 100644 (file)
@@ -1005,9 +1005,11 @@ walkexpr(Node **np, NodeList **init)
                 */
                et = n->left->type->etype;
                if(iscomplex[et] && n->op == ODIV) {
-                       n = mkcall("complex128div", n->type, init,
+                       t = n->type;
+                       n = mkcall("complex128div", types[TCOMPLEX128], init,
                                conv(n->left, types[TCOMPLEX128]),
                                conv(n->right, types[TCOMPLEX128]));
+                       n = conv(n, t);
                        goto ret;
                }
                /*