From cd7e65f97e1fa7ba654d1ba55941668964528a81 Mon Sep 17 00:00:00 2001 From: uz Date: Sun, 22 Apr 2012 21:38:31 +0000 Subject: [PATCH] Fixed an uniniitalized variable which caused ranom error messages on static local variables. git-svn-id: svn://svn.cc65.org/cc65/trunk@5650 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/locals.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cc65/locals.c b/src/cc65/locals.c index 626acaa6b..ef7420475 100644 --- a/src/cc65/locals.c +++ b/src/cc65/locals.c @@ -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); } -- 2.39.5