diff options
| author | grischka <grischka> | 2013-01-06 17:20:44 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2013-01-06 17:20:44 +0100 |
| commit | 2358b378b3cd526956713f033f5a0ecaa5f63951 (patch) | |
| tree | 5b67d60c2992994e629276cbd0ff313d5219c716 /tccgen.c | |
| parent | e92dbe46869085d04544904b21c02991c226a828 (diff) | |
| download | tinycc-2358b378b3cd526956713f033f5a0ecaa5f63951.tar.gz tinycc-2358b378b3cd526956713f033f5a0ecaa5f63951.tar.bz2 | |
tccpp: alternative fix for #include_next infinite loop bug
This replaces commit 3d409b08893873b917ccb8c34398bc41a4e84d7c
- 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
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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); |
