mirror of
https://github.com/mirror/tinycc.git
synced 2026-09-03 12:12:46 +08:00
Fix crash on invalid code
like on 'enum myenum { L = -1 } L;'. It's a bit tedious as
there are two paths (for global vs local symbols), and because
the scope and enum_val share same storage.
This commit is contained in:
@@ -124,4 +124,10 @@ void f() { _Generic((int const *[]){0}, int:0); }
|
||||
void f() { _Generic((int (*(*)(float,char))(double,int)){0}, int:0); }
|
||||
#elif defined test_array_to_str
|
||||
void f() { _Generic((int(*)[3]){0}, int:0); }
|
||||
#elif defined test_duplicate_def_1
|
||||
static enum myenum { L = -1 } L;
|
||||
#elif defined test_duplicate_def_2
|
||||
void foo(void) {
|
||||
static enum myenum { L = -1 } L;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -53,3 +53,9 @@
|
||||
|
||||
[test_array_to_str]
|
||||
60_errors_and_warnings.c:126: error: type 'int (*)[3]' does not match any association
|
||||
|
||||
[test_duplicate_def_1]
|
||||
60_errors_and_warnings.c:128: error: redefinition of 'L'
|
||||
|
||||
[test_duplicate_def_2]
|
||||
60_errors_and_warnings.c:131: error: redeclaration of 'L'
|
||||
|
||||
Reference in New Issue
Block a user