]> git.sur5r.net Git - cc65/blobdiff - src/cc65/locals.c
Fixed an uniniitalized variable which caused ranom error messages on static
[cc65] / src / cc65 / locals.c
index 626acaa6b0473b8a8a54761d598429c310c2480c..ef7420475bd71318bcb0014515c817e1b2d0439c 100644 (file)
@@ -176,7 +176,7 @@ static void ParseRegisterDecl (Declaration* Decl, int Reg)
 
 
 
-static void ParseAutoDecl (Declaration* Decl)
+static void ParseAutoDecl (Declaration* Decl)    
 /* Parse the declaration of an auto variable. */
 {
     unsigned  Flags;
@@ -392,8 +392,11 @@ static void ParseStaticDecl (Declaration* Decl)
 
     } else {
 
+        /* Get the size of the variable */
+        Size = SizeOf (Decl->Type);
+
         /* Allocate a label and space for the variable in the BSS segment */
-        AllocStorage (DataLabel, g_usebss, SizeOf (Sym->Type));
+        AllocStorage (DataLabel, g_usebss, Size);
 
     }