tccpp: alternative fix for #include_next infinite loop bug

This replaces commit 3d409b0889

- revert old fix in libtcc.c
- #include_next: look up the file in the include stack to see
  if it is already included.
Also:
- streamline include code
- remove 'type' from struct CachedInclude (obsolete because we check
  full filename anyway)
- remove inc_type & inc_filename from struct Bufferedfile (obsolete)
- fix bug with TOK_FLAG_ENDIF not being reset
- unrelated: get rid of an 'variable potentially uninitialized' warning
This commit is contained in:
grischka
2013-01-06 17:20:44 +01:00
parent e92dbe4686
commit 2358b378b3
4 changed files with 41 additions and 80 deletions

View File

@ -3284,8 +3284,8 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td)
{
Sym *s;
CType type1, *type2;
int qualifiers, storage, saved_nocode_wanted;
int qualifiers, storage;
while (tok == '*') {
qualifiers = 0;
redo:
@ -3339,12 +3339,12 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td)
storage = type->t & VT_STORAGE;
type->t &= ~VT_STORAGE;
if (storage & VT_STATIC) {
saved_nocode_wanted = nocode_wanted;
int saved_nocode_wanted = nocode_wanted;
nocode_wanted = 1;
}
post_type(type, ad);
if (storage & VT_STATIC)
post_type(type, ad);
nocode_wanted = saved_nocode_wanted;
} else
post_type(type, ad);
type->t |= storage;
if (tok == TOK_ATTRIBUTE1 || tok == TOK_ATTRIBUTE2)
parse_attribute(ad);