mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 15:29:46 +00:00
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:
parent
438444cdd6
commit
9941f3d84a
@ -171,12 +171,6 @@ static void ParseOneDecl (const DeclSpec* Spec)
|
||||
/* Get the size of the variable */
|
||||
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)) {
|
||||
|
||||
@ -292,6 +286,11 @@ static void ParseOneDecl (const DeclSpec* Spec)
|
||||
/* Allow initialization of static vars */
|
||||
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 */
|
||||
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 */
|
||||
|
Loading…
Reference in New Issue
Block a user