Alternative fix for Issue #1167.

This commit is contained in:
acqn
2020-08-15 09:10:17 +08:00
committed by Oliver Schmidt
parent 0afa1a9a95
commit f206833a20
9 changed files with 19 additions and 64 deletions

View File

@@ -77,6 +77,7 @@ static void Parse (void)
{
int comma;
SymEntry* Entry;
FuncDesc* FuncDef = 0;
/* Go... */
NextToken ();
@@ -187,9 +188,9 @@ static void Parse (void)
/* Convert an empty parameter list into one accepting no
** parameters (same as void) as required by the standard.
*/
FuncDesc* D = GetFuncDesc (Decl.Type);
if (D->Flags & FD_EMPTY) {
D->Flags = (D->Flags & ~FD_EMPTY) | FD_VOID_PARAM;
FuncDef = GetFuncDesc (Decl.Type);
if (FuncDef->Flags & FD_EMPTY) {
FuncDef->Flags = (FuncDef->Flags & ~FD_EMPTY) | FD_VOID_PARAM;
}
} else {
/* Just a declaration */
@@ -315,7 +316,7 @@ SkipOneDecl:
NextToken ();
} else {
/* Parse the function body */
NewFunc (Entry);
NewFunc (Entry, FuncDef);
}
}