commit 6e2151255c39198d662f840b44f6cbe74412d39e
parent 20a0b655a525a5b087afccfda1ea52f201b7a779
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 28 Apr 2026 11:01:06 +0200
cc1: Fix compound union initializers
There was a typo using sym (the symbol to initialize) instead of using
init (the symbol of the initializer).
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cmd/scc-cc/cc1/init.c b/src/cmd/scc-cc/cc1/init.c
@@ -416,7 +416,7 @@ autocomp(Symbol *sym, Node *np, Type *tp, unsigned long long *addr)
autofield(sym, aux, aux->type, addr);
break;
case UNION:
- aux = (init) ? sym->u.init[0] : NULL;
+ aux = (init) ? init->u.init[0] : NULL;
p = (aux) ? aux->type : tp->p.fields[0]->type;
autocomp(sym, aux, p, addr);
break;