shithub: scc

Download patch

ref: 5c33e4a03fa4f581ffdfce4d5b294071611257f1
parent: 5af47d7b6fc1fd363a1595f30543e57f73947e3c
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Nov 5 02:37:37 EST 2013

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.

--- a/decl.c
+++ b/decl.c
@@ -130,12 +130,12 @@
 	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('}'));