mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Initialize global string vars correctly.
Ouch, I'd fixed that for arrays, but not normal vars.
This commit is contained in:
parent
9095e1eabc
commit
cc24e2e67e
1 changed files with 7 additions and 2 deletions
|
@ -515,8 +515,13 @@ initialize_def (symbol_t *sym, type_t *type, expr_t *init, defspace_t *space,
|
|||
ex_value_t v = init->e.value;
|
||||
if (is_scalar (sym->type))
|
||||
convert_value (&v, sym->type);
|
||||
memcpy (D_POINTER (void, sym->s.def), &v.v,
|
||||
type_size (type) * sizeof (pr_type_t));
|
||||
if (v.type == ev_string) {
|
||||
EMIT_STRING (sym->s.def->space, D_STRING (sym->s.def),
|
||||
v.v.string_val);
|
||||
} else {
|
||||
memcpy (D_POINTER (void, sym->s.def), &v.v,
|
||||
type_size (type) * sizeof (pr_type_t));
|
||||
}
|
||||
}
|
||||
sym->s.def->initialized = sym->s.def->constant = 1;
|
||||
sym->s.def->nosave = 1;
|
||||
|
|
Loading…
Reference in a new issue