Enabled to recognize labels when parsing local variable declarations.
This commit is contained in:
@@ -1248,11 +1248,23 @@ static void ParseTypeSpec (DeclSpec* D, long Default, TypeCode Qualifiers)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TOK_IDENT:
|
case TOK_IDENT:
|
||||||
Entry = FindSym (CurTok.Ident);
|
/* This could be a label */
|
||||||
if (Entry && SymIsTypeDef (Entry)) {
|
if (NextTok.Tok != TOK_COLON) {
|
||||||
/* It's a typedef */
|
Entry = FindSym (CurTok.Ident);
|
||||||
NextToken ();
|
if (Entry && SymIsTypeDef (Entry)) {
|
||||||
TypeCopy (D->Type, Entry->Type);
|
/* It's a typedef */
|
||||||
|
NextToken ();
|
||||||
|
TypeCopy (D->Type, Entry->Type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* This is a label. Use the default type flag to end the loop
|
||||||
|
** in DeclareLocals. The type code used here doesn't matter as
|
||||||
|
** long as it has no qualifiers.
|
||||||
|
*/
|
||||||
|
D->Flags |= DS_DEF_TYPE;
|
||||||
|
D->Type[0].C = T_QUAL_NONE;
|
||||||
|
D->Type[1].C = T_END;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
/* FALL THROUGH */
|
||||||
|
|||||||
Reference in New Issue
Block a user