[qfcc] Use local_expr only for local variables

ie, not function-scope static variables.
This commit is contained in:
Bill Currie 2021-01-13 18:08:30 +09:00
parent 1fcb16d8cf
commit 64c7efdc0c
1 changed files with 1 additions and 1 deletions

View File

@ -597,7 +597,7 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space,
error (init, "type mismatch in initializer");
return;
}
if (local_expr) {
if (storage == sc_local && local_expr) {
sym->s.def->initialized = 1;
init = assign_expr (new_symbol_expr (sym), init);
// fold_constants takes care of int/float conversions