shithub: scc

Download patch

ref: 6a25f2333af960b52d8a52aab9cb817b2f22dc5a
parent: 86ecad940ba36eef7bbe3c76cc2d76a7f012763a
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Jun 29 17:59:32 EDT 2012

Fixed bug declaring and initializating ctype struct

it can't be a static variable because it will be used in a recursive way. In
other hand the memset call was incorrect to.

--- a/decl.c
+++ b/decl.c
@@ -145,10 +145,11 @@
 
 unsigned char decl(void)
 {
-	static struct ctype ctype;
+	auto struct ctype ctype;
 
 	if (accept(';'))
 		return 1;
+	memset(&ctype, 0, sizeof(ctype));
 	if (!spec(&ctype)) {
 		if (nested_level != 0)
 			return 0;