From 5124e66fcae8a7758460266a4e88944abbe9e686 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 30 Sep 2009 10:25:22 -0700 Subject: [PATCH] c compiler bug tickled by void f(struct { int x[1]; } p) { } the "int" was getting attached to f. R=ken OCL=35145 CL=35151 --- src/cmd/cc/cc.y | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cmd/cc/cc.y b/src/cmd/cc/cc.y index 50d2ecdd87..0ade1d162c 100644 --- a/src/cmd/cc/cc.y +++ b/src/cmd/cc/cc.y @@ -44,6 +44,8 @@ { Type* t1; Type* t2; + Type* t3; + uchar c; } tyty; struct { @@ -925,16 +927,22 @@ sbody: { $$.t1 = strf; $$.t2 = strl; + $$.t3 = lasttype; + $$.c = lastclass; strf = T; strl = T; lastbit = 0; firstbit = 1; + lastclass = CXXX; + lasttype = T; } edecl '}' { $$ = strf; strf = $2.t1; strl = $2.t2; + lasttype = $2.t3; + lastclass = $2.c; } zctlist: -- 2.48.1