From 50db0a36433b6725047e7b62b8ad4c8334c7a0e0 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 14 Oct 1992 10:48:27 +0000 Subject: [PATCH] Fixed scope bug for structures: a(struct S *p) { struct S { int i; }; p->i ... should work --- lang/cem/cemcom.ansi/struct.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lang/cem/cemcom.ansi/struct.c b/lang/cem/cemcom.ansi/struct.c index 939622da0..5c2083e5c 100644 --- a/lang/cem/cemcom.ansi/struct.c +++ b/lang/cem/cemcom.ansi/struct.c @@ -188,7 +188,10 @@ declare_struct(fund, idf, tpp) if (tg && tg->tg_type->tp_size < 0 && tg->tg_type->tp_fund == fund - && tg->tg_level == level) { + && (tg->tg_level == level + || (level >= L_FORMAL2 + && level <= L_LOCAL + && tg->tg_level == L_FORMAL2))) { /* An unfinished declaration has preceded it. We just fill in the answer. */