The last patch did not work correctly in call cases - fix that

git-svn-id: svn://svn.cc65.org/cc65/trunk@1183 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-03-10 14:34:20 +00:00
parent 438444cdd6
commit 9941f3d84a

View File

@@ -171,12 +171,6 @@ static void ParseOneDecl (const DeclSpec* Spec)
/* Get the size of the variable */ /* Get the size of the variable */
Size = SizeOf (Decl.Type); Size = SizeOf (Decl.Type);
/* Cannot allocate a variable of zero size */
if (Size == 0) {
Error ("Variable `%s' has unknown size", Decl.Ident);
return;
}
/* */ /* */
if (SC & (SC_AUTO | SC_REGISTER)) { if (SC & (SC_AUTO | SC_REGISTER)) {
@@ -292,6 +286,11 @@ static void ParseOneDecl (const DeclSpec* Spec)
/* Allow initialization of static vars */ /* Allow initialization of static vars */
ParseInit (Decl.Type); ParseInit (Decl.Type);
/* If the previous size has been unknown, it must be known now */
if (Size == 0) {
Size = SizeOf (Decl.Type);
}
/* Mark the variable as referenced */ /* Mark the variable as referenced */
SC |= SC_REF; SC |= SC_REF;
@@ -310,6 +309,11 @@ static void ParseOneDecl (const DeclSpec* Spec)
} }
} }
/* Cannot allocate a variable of zero size */
if (Size == 0) {
Error ("Variable `%s' has unknown size", Decl.Ident);
return;
}
} }
/* If the symbol is not marked as external, it will be defined */ /* If the symbol is not marked as external, it will be defined */