From 4de360ee2b48a5a0631c015443cf279277415423 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 20 Oct 2025 16:42:08 +0200 Subject: c: fix initializer designators again (?) --- c/c.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'c/c.c') diff --git a/c/c.c b/c/c.c index 89bec50..99d3856 100644 --- a/c/c.c +++ b/c/c.c @@ -1501,14 +1501,11 @@ designators(struct initparser *ip, struct comp *cm) error(&span, "member designator used with non-aggregate type '%ty'", ip->sub->ty); else if (tk.t == TKIDENT) { int idx; + //if (!strcmp(tk.s, "_vb")) __asm__("int3;nop"); for (;;) { idx = aggdesignator(ip, ip->sub->ty, tk.s, &span); - if (idx >= 0) break; - if (ip->sub != ip->cur && !ttypenames[typedata[ip->sub->ty.dat].id]) { - /* if in anonymous aggregate, go up and look again */ - --ip->sub; - continue; - } + if (idx >= 0 || ip->sub == ip->cur) break; + --ip->sub; } ip->sub->idx = idx; if (idx < 0) -- cgit v1.2.3