scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 5c33e4a03fa4f581ffdfce4d5b294071611257f1
parent 5af47d7b6fc1fd363a1595f30543e57f73947e3c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue,  5 Nov 2013 07:37:37 +0100

Fix calculation of nested structs

We have to increment the number of nested tags only when we have
a struct declaration, not always the word struct happens in the code.

Diffstat:
decl.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/decl.c b/decl.c @@ -130,12 +130,12 @@ structdcl(register struct ctype *tp) if (nested_tags == NR_STRUCT_LEVEL) error("too much nested structs/unions"); - ++nested_tags; if (!accept('{')) return; if (!tp->forward) error("struct/union already defined"); + ++nested_tags; do fielddcl(tp->ns); while (!accept('}'));