summaryrefslogtreecommitdiff
path: root/src/cmd/gc/sinit.c
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2010-03-20 18:50:01 -0700
committerKen Thompson <ken@golang.org>2010-03-20 18:50:01 -0700
commita9abc37f5fc92bb29f6d31cd0c075b1a55d9b284 (patch)
tree943f64a395c82bdf0aedb57e61d2985659d7f5e9 /src/cmd/gc/sinit.c
parent47702cfaa56a0ac03e50e138bc517af59a2841dc (diff)
downloadgolang-a9abc37f5fc92bb29f6d31cd0c075b1a55d9b284.tar.gz
issue 682
complex DATA statement fo initialization of complex variables. R=rsc CC=golang-dev http://codereview.appspot.com/634045
Diffstat (limited to 'src/cmd/gc/sinit.c')
-rw-r--r--src/cmd/gc/sinit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/gc/sinit.c b/src/cmd/gc/sinit.c
index fd73dc0ad..6f0772b63 100644
--- a/src/cmd/gc/sinit.c
+++ b/src/cmd/gc/sinit.c
@@ -826,6 +826,13 @@ gen_as_init(Node *n)
gdata(&nam, nr, nr->type->width);
break;
+ case TCOMPLEX64:
+ case TCOMPLEX128:
+ case TCOMPLEX:
+ gused(N); // in case the data is the dest of a goto
+ gdatacomplex(&nam, nr->val.u.cval);
+ break;
+
case TSTRING:
gused(N); // in case the data is the dest of a goto
gdatastring(&nam, nr->val.u.sval);