From a9abc37f5fc92bb29f6d31cd0c075b1a55d9b284 Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Sat, 20 Mar 2010 18:50:01 -0700 Subject: issue 682 complex DATA statement fo initialization of complex variables. R=rsc CC=golang-dev http://codereview.appspot.com/634045 --- src/cmd/gc/sinit.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/cmd/gc/sinit.c') 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); -- cgit v1.2.3