mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
initialized locals are a little trickier...
This commit is contained in:
parent
f8ed454547
commit
897b49140a
1 changed files with 4 additions and 3 deletions
|
@ -421,12 +421,13 @@ opt_initializer
|
|||
;
|
||||
|
||||
var_initializer
|
||||
: '=' fexpr
|
||||
: '=' expr // don't bother folding twice
|
||||
{
|
||||
if (current_scope->type == sc_local
|
||||
|| current_scope->type == sc_params) {
|
||||
append_expr (local_expr,
|
||||
assign_expr (new_def_expr ($<def>0), $2));
|
||||
expr_t *expr = assign_expr (new_def_expr ($<def>0), $2);
|
||||
expr = fold_constants (expr);
|
||||
append_expr (local_expr, expr);
|
||||
def_initialized ($<def>0);
|
||||
} else {
|
||||
$2 = constant_expr ($2);
|
||||
|
|
Loading…
Reference in a new issue