Fix declared arrays without size
This commit is contained in:
parent
dd5b546bf7
commit
f5b8444739
1 changed files with 2 additions and 1 deletions
3
tccgen.c
3
tccgen.c
|
@ -8375,7 +8375,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
|
||||||
|
|
||||||
Section *sec;
|
Section *sec;
|
||||||
Sym *flexible_array;
|
Sym *flexible_array;
|
||||||
Sym *sym = NULL;
|
Sym *sym;
|
||||||
int saved_nocode_wanted = nocode_wanted;
|
int saved_nocode_wanted = nocode_wanted;
|
||||||
#ifdef CONFIG_TCC_BCHECK
|
#ifdef CONFIG_TCC_BCHECK
|
||||||
int bcheck = tcc_state->do_bounds_check && !NODATA_WANTED;
|
int bcheck = tcc_state->do_bounds_check && !NODATA_WANTED;
|
||||||
|
@ -8516,6 +8516,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
|
||||||
vset(type, r, addr);
|
vset(type, r, addr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
sym = NULL;
|
||||||
if (v && scope == VT_CONST) {
|
if (v && scope == VT_CONST) {
|
||||||
/* see if the symbol was already defined */
|
/* see if the symbol was already defined */
|
||||||
sym = sym_find(v);
|
sym = sym_find(v);
|
||||||
|
|
Loading…
Add table
Reference in a new issue