ref: e58e000f02f4ed8c9655eb587cc6f817b84af1f1
parent: 5e8ed05e7151c938cdc3342d9dea15b21a8e9491
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Sep 10 18:33:37 EDT 2015
Integrate initlist in initiliazer()
--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -980,31 +980,18 @@
/* TODO: check correctness of the initializator */
/* TODO: emit initializer */
-static void
-initlist(void)
-{- Node *np;
-
- if (yytoken == '}')
- return;
-
- do {- if (accept('{'))- initlist();
- assign();
- } while (accept(','));-
- expect('}');-}
-
void
initializer(Symbol *sym)
{Node *np;
+ Type *tp = sym->type;
int flags = sym->flags;
if (accept('{')) {- initlist();
+ do {+ initializer(sym);
+ } while (accept(','));+ expect('}'); return;
}
np = assignop(OINIT, varnode(sym), assign());
--
⑨