mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 20:20:43 +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
|
var_initializer
|
||||||
: '=' fexpr
|
: '=' expr // don't bother folding twice
|
||||||
{
|
{
|
||||||
if (current_scope->type == sc_local
|
if (current_scope->type == sc_local
|
||||||
|| current_scope->type == sc_params) {
|
|| current_scope->type == sc_params) {
|
||||||
append_expr (local_expr,
|
expr_t *expr = assign_expr (new_def_expr ($<def>0), $2);
|
||||||
assign_expr (new_def_expr ($<def>0), $2));
|
expr = fold_constants (expr);
|
||||||
|
append_expr (local_expr, expr);
|
||||||
def_initialized ($<def>0);
|
def_initialized ($<def>0);
|
||||||
} else {
|
} else {
|
||||||
$2 = constant_expr ($2);
|
$2 = constant_expr ($2);
|
||||||
|
|
Loading…
Reference in a new issue