Commit cb3754fd authored by Ken Thompson's avatar Ken Thompson

fix error converting result of complex

division. resolves issue 1261.

R=rsc
CC=golang-dev
https://golang.org/cl/2985043
parent 56bfe95e
...@@ -1005,9 +1005,11 @@ walkexpr(Node **np, NodeList **init) ...@@ -1005,9 +1005,11 @@ walkexpr(Node **np, NodeList **init)
*/ */
et = n->left->type->etype; et = n->left->type->etype;
if(iscomplex[et] && n->op == ODIV) { 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->left, types[TCOMPLEX128]),
conv(n->right, types[TCOMPLEX128])); conv(n->right, types[TCOMPLEX128]));
n = conv(n, t);
goto ret; goto ret;
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment